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
 
Top