date formatting

Results 1 to 2 of 2

Thread: date formatting

  1. #1
    Join Date
    Dec 1969

    Default date formatting

    i have a date field like 04/01/2003 (01 April 2003). for retriving the day, month and year separately, i am using the day(date) and year(date) and month(date).<BR><BR>while retriving the date, i am getting the value as 1 or 2 etc.<BR>what should i do if i need the value as &#039;01&#039;<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: date formatting

    You could simply check the length and "left fill"<BR><BR>strTwoDigitDate = cStr(intDayNo)<BR>If len(strTwoDigitDate) &#060; 2 Then<BR> strTwoDigitDate = "0" & strTwoDigitDate<BR>End If<BR><BR>Not great, but gets the job done. I&#039;m sure someone knows a better way.<BR><BR>Key

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts