Can anyone help?
I have a table of invoices, what i am trying to do is enter a date in a text box then get the total invoices up to and including that date. Sounds simple, and it all works fine until....
If I enter a date, say 27/8/16 and the last invoice raised is actually on 20/8/16 it totals them fine, if (and this does happen) I have say 3 invoices on 20/8/16 then it only adds the first one. the SQL statement i am using is :-
stat_date is the date I enter
what am i doing wrong?
thanks.
I have a table of invoices, what i am trying to do is enter a date in a text box then get the total invoices up to and including that date. Sounds simple, and it all works fine until....
If I enter a date, say 27/8/16 and the last invoice raised is actually on 20/8/16 it totals them fine, if (and this does happen) I have say 3 invoices on 20/8/16 then it only adds the first one. the SQL statement i am using is :-
stat_date is the date I enter
Code:
SELECT DISTINCTROW [Invoice No].Amount, [Invoice No].Payment, [Invoice No].[Client Ref], [Invoice No].Date
FROM [Invoice No]
GROUP BY [Invoice No].Amount, [Invoice No].Payment, [Invoice No].[Client Ref], [Invoice No].Date
HAVING ((([Invoice No].[Client Ref])=[Forms]![Event Log]![Client Ref]) AND (([Invoice No].Date)<=[Forms]![Event Log]![stat_date]))
ORDER BY [Invoice No].Date;
what am i doing wrong?
thanks.