Change from 1st Day of Month to Last day

B

Bob Vance

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)));
 
M

Michael Gramelspacher

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)));

try: Dateadd("m",Datediff("m",1,[ondate]),1)
 
B

Bob Vance

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

Michael Gramelspacher said:
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)));

try: Dateadd("m",Datediff("m",1,[ondate]),1)
 
M

Michael Gramelspacher

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

Michael Gramelspacher said:
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)));

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.
 
M

Michael Gramelspacher

Micheal, is there a way to change my code from /30> to the whole Month
Thanks Bob

Michael Gramelspacher said:
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

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)));

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.

You still have not explained what you want to accomplish. What is wrong with what you are doing
now?
 
B

Bob Vance

Micheal, is there a way to change my code from /30> to the whole Month
Thanks Bob

Michael Gramelspacher said:
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

Michael Gramelspacher said:
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)));

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.
 

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

Top