Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / August 2008

Tip: Looking for answers? Try searching our database.

Change from 1st Day of Month to Last day

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob Vance - 13 Aug 2008 00:00 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.