Grouping Query by Date Problem (1 Viewer)

access2010

Registered User.
Local time
Today, 09:35
Joined
Dec 26, 2009
Messages
1,021
Hello.

We would like to use the attached Query for a footer in a Access 2003 report.

I can not find a way to have the following date grouping in our query.

Between #8/1/2015# And #7/31/2016#

Your assistance would be appreciated.

Nicole
 

Attachments

  • Group_By_Date.mdb
    300 KB · Views: 61

pbaldy

Wino Moderator
Staff member
Local time
Today, 09:35
Joined
Aug 30, 2003
Messages
36,125
Change Expression to Where on the date field and see if that gives the desired result.
 

access2010

Registered User.
Local time
Today, 09:35
Joined
Dec 26, 2009
Messages
1,021
Thank you for your suggestion which we have tried,
Between #8/1/2015# And #7/31/2016#
Where #8/1/2015#" And #7/31/2016#
"Where VendorInvoiceDate" #8/1/2015# And #7/31/2016#

but still receive the error message below

You tried to execute a query that does not include the specified expression “VendorInvoiceDate” as part of an aggregate function
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:35
Joined
Feb 19, 2002
Messages
43,266
This is how the query should look

SELECT VendorPayables.InvoiceDistribution, Sum(VendorPayables.InvoiceTotal) AS SumOfInvoiceTotal
FROM VendorPayables
WHERE (((VendorPayables.VendorInvoiceDate) Between #8/1/2015# And #7/31/2016#))
GROUP BY VendorPayables.InvoiceDistribution;

Looking at it in QBE view, where it says "expression" should be replaced with "where" and that will fix the problem.
 

access2010

Registered User.
Local time
Today, 09:35
Joined
Dec 26, 2009
Messages
1,021
T H A N K S

Thank you for helping us with this Sub Report Query which now works

Nicole
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 09:35
Joined
Aug 30, 2003
Messages
36,125
No problem Nicole.
 

Users who are viewing this thread

Top Bottom