Query

A

Anna

Hi: When i run my query between two dates its not sum WM_Amt on the
basis of two dates

SELECT tbl_WebMail.CRC, Sum(tbl_WebMail.WM_Amt) AS Totamnt,
tbl_WebMail.WM_Date
FROM tbl_WebMail
GROUP BY tbl_WebMail.CRC, tbl_WebMail.WM_Date
HAVING (((tbl_WebMail.WM_Date) Between
[Forms]![frmWeb_Mailfilter]![txtdate1] And
[Forms]![frmWeb_Mailfilter]![txtdate2]));

CRC Totamnt
Acito, Lisa 20
Acito, Lisa 40
Acito, Lisa 60
Barnes, Sylvia 7
Barnes, Sylvia 3

Must Be
Acito, Lisa 120
Barnes, Sylvia 10

Thanks,
 
D

Duane Hookom

Or in the SELECT clause.

--
Duane Hookom
MS Access MVP

J. Goddard said:
The date should not be in the group by clause.

John

Hi: When i run my query between two dates its not sum WM_Amt on the
basis of two dates

SELECT tbl_WebMail.CRC, Sum(tbl_WebMail.WM_Amt) AS Totamnt,
tbl_WebMail.WM_Date
FROM tbl_WebMail
GROUP BY tbl_WebMail.CRC, tbl_WebMail.WM_Date
HAVING (((tbl_WebMail.WM_Date) Between
[Forms]![frmWeb_Mailfilter]![txtdate1] And
[Forms]![frmWeb_Mailfilter]![txtdate2]));

CRC Totamnt
Acito, Lisa 20
Acito, Lisa 40
Acito, Lisa 60
Barnes, Sylvia 7
Barnes, Sylvia 3

Must Be
Acito, Lisa 120
Barnes, Sylvia 10

Thanks,
 
J

J. Goddard

sorry, yes; I read it too fast and didn't notice it. Thanks for the
correction.

John
 

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

Similar Threads

Blank Report 1
Prompt to enter date again 5
Print date from form into report 1
Left Join 0
Need to add date sorting to form 5
IIF Stament in a Query 4
Debit Card Purchases 0
Using Wildcards in a query... 1

Top