datepart function

  • Thread starter Thread starter iccsi
  • Start date Start date
I

iccsi

I want to use datepart function to get date part always 2 digits like
following

DatePart("d", MyDate)

If MyDate is Jan/1/2011 then "01" but the function return "1"
Same as the month, I need get DatePart("m", MyDate) to return "01",
but not one.

I just wanted to know any option can do this or I need create my
function for this?

Your help is great appreciated,
 
Others have shown a couple methods but it is important for you to realize
that datepart returns a number.
Numbers are always 1,2,3,4 etc. and formatting is the only way to geet
leading zeros.

Thanks a millions for helping,
 
Back
Top