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

Need to Insert Leading Zero to Month Value 1

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
US
hi experts,

If I use the month function, it returns a single digit (for months 1 thru 9).

I need to get it to a 2 digit value.
If I have : curMonth = month() I get a value of 1

How can I insert a leading zero to get a value of '01' ?

Pretty simple stuff, but I'm stumped.
Thanks, John


 
Like this.
[tt]
curMonth=right("00" & month(now),2)
[/tt]
- tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top