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

MonthEnd Date

Status
Not open for further replies.

AccessVB

MIS
Jun 23, 2002
82
0
0
US
Is there a way to generate the MonthEnd date for any month using VB? Need to create a record in a table with MonthEnd Date of the previous month when a user runs a certain macro...Any help will be appreciated. Thanks.
 


Code:
DateSerial(Year(Date),Month(Date)+1,0)-1


Skip,
[sub]
[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][/sub]
 

I think Skip is being too clever for his own good here. He means either
Code:
DateSerial(Year(Date),Month(Date)+1,0)
or
Code:
DateSerial(Year(Date),Month(Date)+1,1)-1

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 


[blush] I threw BOTH in there, didn't I.

Skip,
[sub]
[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][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top