If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Aggregate function
Hi I am new to Access and I need help! I am trying to create this query and
so far this is what I have: SELECT Sum([ACT_TRVL]) AS Total, tblAttendan.TRVL_START FROM tblAttendan WHERE (((tblAttendan.TRVL_START)#1/1/2007# And (tblAttendan.TRVL_START)#3/30/2007#)); What I get is a error: You tried to execute a query that does not include the specified expression name as part of an aggregate function. (Error 3122) What I want is to give me a total of Act_Trvl between the months of 01/01/2007 and 03/30/2007 Thank You for any help..... |
#2
|
|||
|
|||
Aggregate function
hi,
Amour wrote: SELECT Sum([ACT_TRVL]) AS Total, tblAttendan.TRVL_START FROM tblAttendan WHERE (((tblAttendan.TRVL_START)#1/1/2007# And (tblAttendan.TRVL_START)#3/30/2007#)); What I get is a error: You tried to execute a query that does not include the specified expression name as part of an aggregate function. (Error 3122) Just drop TRVL_START from the select list. mfG -- stefan -- |
#3
|
|||
|
|||
Aggregate function
Hi and thank you for your response. What I need Trvl_start for is that I
want totals during a time period. Please help! "Stefan Hoffmann" wrote: hi, Amour wrote: SELECT Sum([ACT_TRVL]) AS Total, tblAttendan.TRVL_START FROM tblAttendan WHERE (((tblAttendan.TRVL_START)#1/1/2007# And (tblAttendan.TRVL_START)#3/30/2007#)); What I get is a error: You tried to execute a query that does not include the specified expression name as part of an aggregate function. (Error 3122) Just drop TRVL_START from the select list. mfG -- stefan -- |
#4
|
|||
|
|||
Aggregate function
From looking at both of your posts, why you are not creating a report that
list the total for each date and in the report footer to have Sum fields that gives you the Grand Total -- Good Luck BS"D "Amour" wrote: Hi and thank you for your response. What I need Trvl_start for is that I want totals during a time period. Please help! "Stefan Hoffmann" wrote: hi, Amour wrote: SELECT Sum([ACT_TRVL]) AS Total, tblAttendan.TRVL_START FROM tblAttendan WHERE (((tblAttendan.TRVL_START)#1/1/2007# And (tblAttendan.TRVL_START)#3/30/2007#)); What I get is a error: You tried to execute a query that does not include the specified expression name as part of an aggregate function. (Error 3122) Just drop TRVL_START from the select list. mfG -- stefan -- |
#5
|
|||
|
|||
Aggregate function
Thank You for your help..
I put this in the SQL statement: SELECT tblAttendan.TRVL_START, tblAttendan.ACT_TRVL, tblAttendan.ACT_TRVL, tblAttendan.TRVL_START, Sum(tblAttendan.ACT_TRVL) AS Totals FROM tblAttendan WHERE (((tblAttendan.TRVL_START) Between #1/1/2007# And #3/30/2007#)) GROUP BY tblAttendan.TRVL_START, tblAttendan.ACT_TRVL, tblAttendan.TRVL_START; And then put totals on the report footer, but I am getting zero amount. Please help what am I doing wrong? "Ofer Cohen" wrote: From looking at both of your posts, why you are not creating a report that list the total for each date and in the report footer to have Sum fields that gives you the Grand Total -- Good Luck BS"D "Amour" wrote: Hi and thank you for your response. What I need Trvl_start for is that I want totals during a time period. Please help! "Stefan Hoffmann" wrote: hi, Amour wrote: SELECT Sum([ACT_TRVL]) AS Total, tblAttendan.TRVL_START FROM tblAttendan WHERE (((tblAttendan.TRVL_START)#1/1/2007# And (tblAttendan.TRVL_START)#3/30/2007#)); What I get is a error: You tried to execute a query that does not include the specified expression name as part of an aggregate function. (Error 3122) Just drop TRVL_START from the select list. mfG -- stefan -- |
Thread Tools | |
Display Modes | |
|
|