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!

maximum days in a month 1

Status
Not open for further replies.

Bignewbie

Programmer
Feb 22, 2001
351
PH
Hi Guys!

is there a fast way of getting the maximum number of days in a given month? i looked at the faq section for this but its not there. this should be able to tell whether its a leap year or not, thereby adjusting the maximum days in february.


Thanks!


biggie



The Man of Tomorrow is forged by his battles today.
 
thread333-732176

should help

___________________________________________________________________
[sub]
The answer to your ??'s may be closer then you think.
Check out Tek-Tips knowledge bank by clicking the FAQ link at the top of the page
[/sub]
 
That's exactly what i need! thanks! I gave you a star for giving me a link to it. It really helped!



thanks,

biggie




The Man of Tomorrow is forged by his battles today.
 
Small is beautiful, right?

Code:
Function monthDays( iMonth, iYear )
	Dim dDate: dDate = DateSerial( iYear, iMonth, 1 )
	monthDays = DateDiff( "d", dDate, DateAdd("m", 1, dDate) )
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top