Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum query

Status
Not open for further replies.

markstangroom

Technical User
Apr 25, 2001
96
GB
i am trying to run a simple query to add up the totals in various column in a table between two date

my query is

SELECT SUM(inperson) AS totalinperson, SUM(byemail) AS totalemail, etc etc FROM reception WHERE inputdate BETWEEN '01/03/2004' AND '31/03/2004' ;

but the results are coming up with sum impossible figures.

what am i doing wrong?
 
I don't see you to have any GROUP statement. Try to group the records by a criteria, even if you need the sum of all the records.

Cristian

********************************
It's nice to be important, but it's more important to be nice.
 
if i use the group by statement i get a list of values for each day. what i need to do it to add up all the values for all the dates into one total.

how can i do this?

thanks

Mark
 
Hi markstangroom,

You might try entering it like:

SELECT SUM(inperson) AS totalinperson, SUM(byemail) AS totalemail, etc etc FROM reception WHERE inputdate >= '2004-03-01' AND inutdate <= '2004-03-31';

Regards,

LelandJ

Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top