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!

Date Functions Making Life Difficult

Status
Not open for further replies.

ChopinFan

Technical User
Oct 4, 2004
149
US
I'm seriously confused over this. Why does this datepart syntax correctly return "11":

=DatePart("m",DateAdd("m",-1,Date()))

And this format syntax incorrectly return "January"??:

=Format(DatePart("m",DateAdd("m",-1,Date())),"mmmm")

Help?
 
RTFM? (e.g. the ubiquitous {F1}[/b[ (aks H E L P[/color0)




MichaelRed


 
ChopinFan
Is there a reason not to use just
Format(DateAdd("m",-1,Date()),"mmmm")

That will give you November.

Tom
 

Hi Tom,

I had been combining from two other fields and overlooked the obvious.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top