I want to change my code from The first day of each month to the last day
Please any help................Bob
SELECT qOwnerPercentAmountInPaymentMethodAll.OwnerID,
Sum(qOwnerPercentAmountInPaymentMethodAll.AmountSummary) AS Dues,
IIf((Date()-[ondate])/30>=3,3,IIf((Date()-[ondate])/30>=2,2,IIf((Date()-[ondate])/30>=1,1,0)))
AS MD
FROM qOwnerPercentAmountInPaymentMethodAll
GROUP BY qOwnerPercentAmountInPaymentMethodAll.OwnerID,
IIf((Date()-[ondate])/30>=3,3,IIf((Date()-[ondate])/30>=2,2,IIf((Date()-[ondate])/30>=1,1,0)));

Signature
Thanks in advance for any help with this......Bob
WindowsXP..MS Access 2007
Chris O'C - 13 Aug 2008 00:28 GMT
lastday: DateSerial(Year(aDate),(Month(aDate)+1),0)
Chris
Microsoft MVP
>I want to change my code from The first day of each month to the last day
Michael Gramelspacher - 13 Aug 2008 00:33 GMT
>I want to change my code from The first day of each month to the last day
>Please any help................Bob
[quoted text clipped - 6 lines]
>GROUP BY qOwnerPercentAmountInPaymentMethodAll.OwnerID,
>IIf((Date()-[ondate])/30>=3,3,IIf((Date()-[ondate])/30>=2,2,IIf((Date()-[ondate])/30>=1,1,0)));
try: Dateadd("m",Datediff("m",1,[ondate]),1)
Bob Vance - 13 Aug 2008 01:07 GMT
Sorry Micheal it should be last day of last month, then the last day of the
previous month and so on...
Thanks for the help....Bob
>>I want to change my code from The first day of each month to the last day
>>Please any help................Bob
[quoted text clipped - 8 lines]
>
> try: Dateadd("m",Datediff("m",1,[ondate]),1)
Michael Gramelspacher - 13 Aug 2008 12:07 GMT
>Sorry Micheal it should be last day of last month, then the last day of the
>previous month and so on...
[quoted text clipped - 12 lines]
>>
>> try: Dateadd("m",Datediff("m",1,[ondate]),1)
Sorry, I just do not understand the problem, but I guess you have the solution from Chris anyway.
Bob Vance - 30 Aug 2008 20:18 GMT
Micheal, is there a way to change my code from /30> to the whole Month
Thanks Bob
>>Sorry Micheal it should be last day of last month, then the last day of
>>the
[quoted text clipped - 17 lines]
> Sorry, I just do not understand the problem, but I guess you have the
> solution from Chris anyway.