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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calculate first or last day of a month

Status
Not open for further replies.

JustATheory

IS-IT--Management
Feb 27, 2003
115
US
Greetings,

I have a date column and I'd like to calculate in the next column the last date of the month and from that column the number of days that represents. I'm good with calculating the number of days, but is there a function that will look at a date and give the last date of that month?

Thanks,
Andy
 

Hi,
Code:
LastDay: DateSerial(Year([YourDate]),Month([YourDate])+1,0)

Skip,

[glasses] [red]Be Advised![/red] The only distinction between a bird with one wing and a bird with two, is merely...
a difference of A Pinion! [tongue]
 
Code:
DaysToEndOFMonth =
DateDiff ("d", [DateField], 
DateSerial(Year([DateField), Month([DateField]) + 1, 0))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top