Link to home
Start Free TrialLog in
Avatar of FaithDan
FaithDan

asked on

Convert number yyyymmdd to Date/time mm/dd/yyyy MS Access 2003

Microsoft Access 2003
 I have a table with a number field [Brth_DT] with dates setup as yyyymmdd.  This field is setup with the data type Number.

I am making a make- table Query to convert this number field to a date field in the new table.  I need the new field to be a date field with mm/dd/yyyy.

What expression do I need to use to get this to work in the Query Design View?

Avatar of JestersGrind
JestersGrind
Flag of United States of America image

Try this:

CInt(Left([Brth_DT], 2)), CInt(Mid([Brth_DT], 3, 2))), DateSerial(CInt(Right([Brth_DT], 4))

Greg


Avatar of FaithDan
FaithDan

ASKER

I tried that it says invalid syntax or quotes.  Any Ideas?
ASKER CERTIFIED SOLUTION
Avatar of rockiroads
rockiroads
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If u want it displayed as mm/dd/yyyy you could try changing the format property on the table design.
subsequently doing format("mydatefield","Short Date") will take the format that is defined in your control panel settings
but you can override by doing format("mydatefield","MM/DD/YYYY")
note, only to be done on a date field, not your yyyymmdd field
Thanks Rockiroads... it worked perfeclty
No probs. Glad to have helped, again!!! :)