Aggregate function

G

Guest

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.....
 
S

Stefan Hoffmann

hi,
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 <--
 
G

Guest

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 said:
hi,
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 <--
 
G

Guest

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 said:
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 said:
hi,
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 <--
 
G

Guest

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 said:
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 said:
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 said:
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 <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top