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

Converting the string of a month name to a number

Status
Not open for further replies.

Craftor

Programmer
Joined
Feb 1, 2001
Messages
420
Location
NZ
Hi all

Does anyone know how to convert the string of a month name to an integer e.g. if I have the string "JUNE" how can I change it to a "6"? Is there any function which does this?
I have tried the Month() function but that didn't work.

Any thoughts?
 
MyMnth = 6
? Choose(MyMnth, "Janurary", "Feburary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
? Format(MyMnth & "/1/1", "MMMM")
June
Your Choice

MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Thank you that was a big help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top