Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

End of month/days in a month

Status
Not open for further replies.

yvwo1

IS-IT--Management
Oct 21, 2003
5
US
Is there a relatively simply way to count the number of days there are in this month. Last month WITHOUT hardcoding the month in. What I am going to do is take the number of days in the month, subtract the number of days already past, add the number of days left and multiply the data to do some projections.

Thanks!
 
This will get you the last day of the previous month:
Code:
Maximum(LastFullMonth)

Use the Day function to get the number of days
Code:
Day(Maximum(LastFullMonth))

If you need days remaining in the month, than you could do something like this:
Code:
DateDiff("d", CurrentDate, DateAdd("m",1,DateAdd("d",-(Day(CurrentDate)-1), CurrentDate))-1)

~Brian
 
Works like a charm! Slick! Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top