Format Date Help

  • Thread starter turks67 via AccessMonster.com
  • Start date
T

turks67 via AccessMonster.com

Is there a way to format the date 12/31/2008 to 0081231? I have tried every
which way.

Thanks.
 
D

Douglas J. Steele

Assuming it's a date field (as opposed to a text field that's holding a
date), and that you really meant 0081231 (and not 20081231), try:

Right(Format([TheDateField], "yyyymmdd"), 7)

If 0081231 is a typo, leave out the Right( and , 7)

If it's a date in a text field, use the CDate function to convert it to a
date. Note, though, that that won't work for users who have their Short Date
format set to dd/mm/yyyy
 
T

turks67 via AccessMonster.com

Thank you again.
Assuming it's a date field (as opposed to a text field that's holding a
date), and that you really meant 0081231 (and not 20081231), try:

Right(Format([TheDateField], "yyyymmdd"), 7)

If 0081231 is a typo, leave out the Right( and , 7)

If it's a date in a text field, use the CDate function to convert it to a
date. Note, though, that that won't work for users who have their Short Date
format set to dd/mm/yyyy
Is there a way to format the date 12/31/2008 to 0081231? I have tried
every
which way.

Thanks.
 

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

Top