Forums

This topic is locked

Calculating the total of an Access table's column

Posted 13 Dec 2002 09:56:37
1
has voted
13 Dec 2002 09:56:37 keith Lo posted:
In my company project, I have to calculate the total outstanding balance of a client's different account.

Access Table name - outstanding

Account /outstanding Bal / total sales
"A" /$2000/ $3000
"B" /$3000/ $1000
"C" /$5000 /etc.

I have created a search form after inserting their member name, they can see the information of the account, I use the following code on the result page so that they can see the total outstanding balance:

SELECT Sum(outstanding.outbalance) AS SumofTotalBal
FROM outstanding
where memberNo='memberNo'(I use variables-Request.Form("memberNo"

It work OK on my local server and ISP web hosting server.

However, I try to create a detail page and link with above table and show total sales of the accounts. I use the same code:

SELECT Sum(outstanding.sales) AS SumofTotalSales
FROM outstanding
where memberNo='memberNo'(I use variables-Request.QueryString("memberNo"

This code works fine on my local server, however, not on my ISP web hosting. I can't see any total sales on the page, it is empty. For my previous experience, if there is mistake, an error message will be shown on the page. But this time, nothing is on the screen. I have no idea what the problem and find no way to solve it.

Why this code works fine on the result page but not on the detail page?

If I can't solve this problem, my boss will put pressure on me again.

Hope somebody can help!

Reply to this topic