-
That's not what you mean:
Table name: price
Merchandise 1 20
Merchandise 2 25
Merchandise 3 50
Total** 95
Use a variable to add up each **, for example: n=n+20
-
If you want to sum it, you can use SQL to sum it directly.
c sl is the field you ask for and the sum of.
Cart xx is a table.
CT ID is the condition.
set rs="")
sql= "select sum (c_sl) as c_sl from cart_xx where ct_id = " + replace(ct_id, "'", "''") +""
sql,conn,2,3%>
rs("c_sl")%>
-
The question is ill-described and does not provide a complete answer.
1. Data**;
2. Data structure;
2. Purpose of the data; (Display?) Write to a table in the database? Is this table existing or does it need to be created? If it's existing, is the data emptied every time it is written, or is it categorized with extra columns? ......
-
Well, this won't work, it's even harder.
Make sure that the database has an id field (numeric or auto-numbered), and here's how to change it
id=request("id")
set rs="")
sql,conn,1,2
Then it's up to you to ask for the peace.
id is in the ty table.
The id I want is the sum in the jiaban table.
Another jiaban table? What fields are there?
The id in ty is the sum of (what field or condition) in the jiaban table?
I don't know! Sweat!
-
yxz0539
Correct,But remember not to conflict with the original record set in your web page,It's best to change the name rs to rs1 or rs2 or something.,don't conflict with the original record set rs.。
-
I don't know. Go to the professional ** and ask. I'm sorry.
-
select bigclassname, sum (case bigclassname when 'Technical Articles'then hits else null end) as Total amount of technical articles,sum (case bigclassname when'Company News'then hits else null end) as company news total, sum (case bigclassname when'Corporate culture'then hits else null end) as Total Corporate Culture from News Group by BigClassName
-
select sum(bigclassname) from news where bigclassname like 'Technical Articles'
select sum(bigclassname) from news where bigclassname like 'Company News'
select sum(bigclassname) from news where bigclassname like 'Corporate culture'
-
select date 0, sum(amount) as total amount of day from (select amount, cstr(datepart(.)'yyyy', date)) +'-'+cstr(datepart('m', date)) +'-'+cstr(datepart('d', date)) as Date0 from sheet) group by Date0
On the basis of Songyl525, it has been slightly changed, and the result of access2007 is as follows.
Date 0--- Total amount.
-
Try it this way:
sql="select date2, sum(amount) as amount from (select amount, date as date2 from sheet where id=1 or id=2 or id=5).
group by date 2"
Or (the same, just replace the ID with the address).
sql="select Date2,sum(amount) as AmountFrom (select amount,Date as Date2 from sheet where address='Beijing'or address='Shanghai'or address='Nanjing')
group by date 2"
It's best to use the first one.,Because the quotation marks of the Chinese characters in asp have requirements.,I've tried it in access.,You can meet your requirements.,I didn't try to convert it to asp.,The landlord solves it himself.。
-
y_date="2008-1-1"(give query date) y year = year (y date).
y_month=month(y_date)y_day=day(y_date)
sql="select sum(amount) as total money from sheet where year(date)='"&y_year&"'and month='"&y_month&"'and day ='"&y_day&"'"
-
select date, sum(amount) from (select address, amount, cstr(datepart(.)'yyyy', date)) +'-'+cstr(datepart('m', date)) +'-'+cstr(datepart('d', date)) as Date0 from sheet) group by Date0
-
What type of date is it? If it's a date type:
select convert(char(6),date,112) as riqi,sum(amount) from sheet group by convert(char(6),date,112).
If it's a character:
select left(date,7) as riqi,sum(amount) from sheet group by left(date,7).
-
sql="select sum(field) as total money from table where .Your condition"
Look at this, I'm looking at other people, too, hehe
-
<%function gettotal()
dim rs,sql
sql="select * from sheet where [address] ='Beijing'and [date] ='July'"
set rs = "")
sql,conn,1,1
total = 0
do while not then
total = total+rs("Amount")loop
set rs = nothing
gettotal = total
<%= gettotal %>
-
According to the title, asp vbscript should be.
dim num,x,sum
num = "10,20,30,40,50"
sum = 0
num = split(num,",")
if isarray(num) then
for x = 0 to ubound(num)sum = sum + int(num(x))next
end if
sum***********************************==
If the sum of multiple records in the database is used, SQL is used
select sum(the field) from the table***********************************==
var num = for js"1,2,3,4,5",sum = 0;
num = ",");
for ( var x = 0 ; x < x++
if condition = 1 then
What is shown in condition 1" >>>More
If you're using aspnet, he has a special function in. NET to get a computer name, IP address and current username is very simple, the following are a few methods I commonly use, if you have other good methods, you can reply and sort it out together: >>>More
ASP is an abbreviation for ActiveServerPage, which means "Active Server Web Page". ASP is an application developed by Microsoft to replace CGI scripting programs, which can interact with databases and other programs, and is a simple and convenient programming tool. The format of the asp web page file is: >>>More
Assumption: The variable passed is tt and the value is "2,9". >>>More
The requirements and conditions for joining Didi Express are as follows: >>>More