Expression Question

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

Guest

I have a DOB field that gives me correctly a date this way, for example:
12/12/2005

I, however, would like another field to read out this way: 12122005

This expression partially does it:

DOBPaste: Mid$([DOB],1,2) & Mid$([DOB],4,2) & Mid$([DOB],7,4)

The problem is dates such as 9/9/2005 does NOT come out right when
converting a Date/Time field

Can you help me?

Thank you
 
Use the Format$() function with a Format of "mmddyyyy" (or "ddmmyyyy" as
appropriate). For example, in the Immediate Window ...

? format$(#12/12/2005#,"mmddyyyy")
12122005
 

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

Back
Top