ASP Sum

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I make the results of my asp page have a sum at the bottom for a
particular colum?

Thanks.
 
Did you read the linked tip?
It works because you are creating a DBRW w/ a custom query that returns the Sum of the field named "myAmount" as a new DBRW field
named "MySum" when you add the custom query to the 2nd DBRW using:
SELECT SUM(myAmount) AS MySum

--




| Yes, I'm using the wizard. Second region? How would that make it work?
|
| Thanks.
|
| "Kathleen Anderson [MVP - FrontPage]" wrote:
|
| > Are you using the Database Results Wizard? Add a second DRW Region that
| > mimics the first:
| > http://www.spiderwebwoman.com/resources/dbrwtipsandtricks.asp#sum
| >
| > --
| > ~ Kathleen Anderson
| > Microsoft MVP - FrontPage
| > Spider Web Woman Designs
| > web: http://www.spiderwebwoman.com/resources/
| >
| >
| > | > > How can I make the results of my asp page have a sum at the bottom for a
| > > particular colum?
| > >
| > > Thanks.
| >
| >
| >
 
I duplicated the database region and used the custom code and placed,
SELECT SUM(Extended) AS MySum

When I do that, I get an error "An error occurred accessing your FrontPage
web files. Authors - if authoring against a web server, please contact the
webmaster for the server's site. We have our on web server. It does not
seem to like that code. I'm I doing something wrong?

Thanks.
 
Sorry to keep bothering you but still no luck. I get the same error even
after applying SP2. After I close the error window it say the custom code
has errors in it. Did I put the code in the right place? In the wizard at
the custom code window.

Thanks.
 
Ok. I created a real simple form. It has one search field that I enter a
date and get results for the date. Right now it only has the one DRW. I
thought I would start from scrach pending your suggestions. Here is the code
form the DRW.

Thanks.

<%
fp_sQry="SELECT * FROM new2 WHERE (Date1 = '::Date1::')"
fp_sDefault="Date1="
fp_sNoRecords="<tr><td colspan=1 align=""LEFT"" width=""100%"">No records
returned.</td></tr>"
fp_sDataConn="Database2"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&TaxExclusiveTotal=5&Date1=135&"
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
 
Assuming TaxExclusiveTotal is the field you want to SUM, I would do this:
SELECT *, SUM(TaxExclusiveTotal) AS newTaxExclusiveTotal FROM new2 WHERE
(Date1 = '::Date1::')


--

~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
web: http://www.spiderwebwoman.com/resources/
 
The light bulb finally went off. Thank you so much for all your help. I
could not have done it without your help. Not only did you help me, I now
have a better understanding of the whole concept.

Thanks.
 
Back
Top