Date - 2 digit year storage for text files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to store the year part of a date as two digits for export to a
text file to meet a UK government input requirement. The government have
requested a string that shows dd/mm/yy and although I can separate each day,
month and year element, it doesn't seem possible to concatenate them into a
field stored in the way it is required for output. Formatting doesn't seem to
work here on the original date field. Any suggestions?
 
Format(MyDate, "dd/mm/yy") should be sufficient, although if the slash is
mandatory, you're safer using Format(MyDate, "dd\/mm\/yy") (/ will be
replaced with whatever character has been set to date separator in Regional
Settings. \/ will always use slash)
 
Back
Top