Date - 2 digit year storage for text files

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?
 
D

Douglas J Steele

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top