1樓:網友
public function htmlcode(fstring)
if not isnull(fstring) then
fstring = replace(fstring, "
fstring = replace(fstring, "畝態友",fstring = replace(fstring, chr(32),fstring = replace(fstring, chr(9),fstring = replace(fstring, chr(34),fstring = replace(fstring, chr(39), 閉薯)
fstring = replace(fstring, chr(13),fstring = replace(fstring, chr(10),htmlcode = fstring
end if
end function
用乙個這樣的函式就迅槐可以了。
2樓:網友
%i=1%>枝桐祥。
do while not >
**地猛搏址<%=i%>
i=i+1if i<6 then
elseexit do
end if
不好意思 有點暈。
輪陸%loop%>
asp如何把讀取資料庫中符合條件的數字相加?
3樓:網友
如果只是要乙個合計結果,可以在sql查詢語句中使用合計函式,如。
select sum(payment) from abc where 查詢條件。
如果同時還需要這些記錄的話,可以用迴圈累加,也可以另外再合計查詢一次。
4樓:網友
把符合條件的payment 相加在一起用變數來儲存即可!
關於資料庫或是asp的資料相加..
5樓:夜半凍檸樂
感覺樓主還沒分清什麼是欄位。
data1","type1","num1","data2","type2","num2","data3","type3","num3",..
這些應該是資料吧?有data,type,num三個欄位?
如果是這樣的話。
set rs="select * from table")i=""
do whlie not
if rs("date")=rs("type") theni=i+rs("num")
end if
loopset rs=nothing
6樓:網友
你是想在插入資料庫的時候相加,還是查詢出來後相加?
在資料庫器直接查詢:select sum(num1+num2+num3) as i from table where date1=date2 and date2=date3 and date1=date3
asp**:<%set rs="select * from table")
i=""do whlie not
if rs("date1")=rs("date2") and rs("date2")=rs("date3") and rs("date1")=rs("date3") then
i=num1+num2+num3
)end if
loop>如果是在資料插入資料庫的時候想那樣做,就可以用觸發器操作,在你的table變新建乙個i欄位,既省事又方便,把值存入你這個table表的i欄位。
7樓:悲傷地今天
沒看懂你的意思能再說明白點不?
asp 中資料庫相加問題
8樓:網友
select 數字,sum(**) as 總額 from 表 group by 數字。
用這樣的sql語句查出來的結果集就是數字和對應的總額了,跟讀取普通的表沒有區別。
9樓:網友
我給你寫sql語句。
select sum(**) as 總金額,數字 form tablename group by 數字。
10樓:網友
select sum("**欄位") as 別名 from 表名 where 數字欄位=*
這樣做只能獲取一類相同欄位的總和!要想獲取全部,那要用的分組了!group by
asp怎麼從資料庫中取出前一天的某個值與今天的相加
11樓:匿名使用者
很簡單,在插入id=4的記錄前,讀取id=3的值set rs="select top 1 d from 表名 order by id desc")
d=rs(0)
然後在此處把藥新增的id=4中的a值和d值相加後再新增記錄。
12樓:孤翼單行
delarce @today int;
select a+ from table1 as b jion table1 as a on where
變數好像定義錯了,忘記了,你自己看一下。
13樓:鬼知曉
使用函式和sql語句結合。我真能提供思路。希望對你有幫助。
在asp讀資料庫的記錄時,讓重複的記錄只顯示一條,並把乙個欄位相加
14樓:網友
用sql可以實現!
select name,sum(work) as worksum from 表名 group by name
如果還想按work的資料排序。
select name,sum(work) as worksum from 表名 group by name order by worksum
【資料庫數字相加問題】asp如何把資料庫某一表的同一欄位的所有值(數字)相加(請給出完整**)謝謝
15樓:網友
select sum(要求和的欄位) as 總計 from 表名 group by 分類欄位;
ASP連結資料庫查詢
不一樣啊 第一個 變數的值 menuwhere 這個直接就是一個字串例如 menuwhere china 你的第一句結果就是 select from design where designwhere china order by id 但是 第二句還是select from design where...
asp資料庫條件查詢問題
根本不需要定義 直接 where aa 就可以了set rec sql select from gongqiou where aa order by id desc sql,cnn,, a set rec dim sql sql,cnn,, 樓上的都寫了,呵呵。asp 查詢資料庫問題,select....
ASP連線資料庫錯誤求助
dim stuname,stuid,chengji,xingbie,nianling stuname request stuname stuid request.form stuid chengji request.form chengji xingbie request.滿意 你的sql語句有問題...