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

PS Query - leading zero

Status
Not open for further replies.

deborahyr

Technical User
Nov 14, 2002
63
US
How do I add a leading zero to a number field using an expression?

I have a field in my table that refers to a month but it is single digit 1-12. I would like to see 01-12.

I then plan to concatenate this field with a year field and then create a date field, i.e. 200501 to 20050101.

Can you assist me?
 
I am assuming that you have sorted this out already, but you should be able to do this with a case statement and converting the field to a character type:

eg - expression text,

Case (month_field) when 1 the '01' when 2 then '02' ...end

Hope you have not been holding out for 3 months for this response ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top