CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge -> Programming

 Is there another way to get the sum from custom sSQL ?

Print topic Send  topic

Author Message

Posts: 4
Posted: 12/10/2005, 5:56 PM

Using CC, ASP, MS Access, No Tempates, Microsoft.Jet.OLEDB.4.0.

This works for my grid form:

sSQL = "SELECT order_id, code_tr, code_pk, code_pk as description, quantity, customer, float_bc, daily_late_rate, return_schedule, days_renting, rental_price, date() - return_schedule as late_days, late_days*daily_late_rate as late_fees, late_fees*quantity as extended FROM orders WHERE code_tr=1 and status=1"

However, I would like to get a sum(extended) as GRANDTOTAL.
Example Grid Form (just to get the idea):
ID: 1, Qty: 2 Days Late: 3 Daily Late fee: $1.00 Extended: $6.00
ID: 2, Qty: 3 Days Late: 3 Daily Late fee: $2.00 Extended: $18.00

GRAND TOTAL: $24.00 (the sum from "extended")

I have read about "group by", however it does not work, I am assuming because it is fairly complex sql statement (to me anyways!).
Thanks in Advance!
View profile  Send private message

Posts: 5971
Posted: 12/10/2005, 6:01 PM

I think that the easiest way would be to create a query in MS Access that returns all these values. Then you can use the MS Access query in your grid.
Peter R.
YesSoftware Forums Moderator
For product support please visit
View profile  Send private message

Posts: 4
Posted: 12/10/2005, 8:54 PM

You just turned me on to something I was not even aware of in MS Access. I created a query in sql view (same as grid form) and Wala! CC see's the query table I created and I just did the sum(extended) as grandtotal on a new grid page. It works! (still have to do more testing though :)) You put me on the right track! Thanks a bunch.
View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

Internet Database

Visually create Web enabled database applications in minutes.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.