A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Aggregate function



 
 
Thread Tools Display Modes
  #1  
Old May 7th, 2007, 05:37 PM posted to microsoft.public.access.queries
Amour
external usenet poster
 
Posts: 115
Default 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  
Old May 7th, 2007, 05:46 PM posted to microsoft.public.access.queries
Stefan Hoffmann
external usenet poster
 
Posts: 709
Default 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  
Old May 7th, 2007, 06:15 PM posted to microsoft.public.access.queries
Amour
external usenet poster
 
Posts: 115
Default 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  
Old May 7th, 2007, 06:25 PM posted to microsoft.public.access.queries
Ofer Cohen
external usenet poster
 
Posts: 1,683
Default 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  
Old May 7th, 2007, 08:25 PM posted to microsoft.public.access.queries
Amour
external usenet poster
 
Posts: 115
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.