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

last_day function in Access??!! 1

Status
Not open for further replies.

kingz2000

Programmer
May 28, 2002
304
DE
HI Guys,

in oracle SQL
last_day (to_date('2003/03/15', 'yyyy/mm/dd')) would return Mar 31, 2003

HOw do I get the 'last day' of a month in ACCESS???
Thanks in advance!!
 
Hi
Maybe:
[tt]dateserial(year(date),month(date)+1,1)-1[/tt]
 
last question: How would I find out the last day with merely the month number??:))
 
I am not sure I have got your point, but here goes anyway:
[tt]MnthNo = 10
SomeYear = 2005
Lastday=Day(Dateserial(SomeYear,MnthNo+1,1)-1)[/tt]
 
A simpler version:
Lastday=Day(Dateserial(SomeYear,MnthNo+1,0))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top