HOW TO CONVERT DD-MM-YY to YYYYMMDD IN ACCESS DATABASE?

  • Thread starter Thread starter Potchtalon
  • Start date Start date
P

Potchtalon

HI

I have a project where i need to compare two sets of databases and see where
they match up or not. I one of the databases is using DD-MM-YY data standard
format, while the other is using the YYYYMMDD. I need to convert DD-MM-YY
data into the YYYYMMDD string, so that i can link the two databases together.
I have search the net for help, but yet to see how to do that in SQL/ACCESS.

I figured that first i would convert the DD-MM-YY (ex. 09-Jun-06) into
DD/MM/YYYY, and than convert it to YYYMMDD. That’s my theory. Perhaps there
is a simpler way to do this.

I'm a very new to Access/SQL so any help will be appreciated

Thank you

Anton
 
hi Anton,
I figured that first i would convert the DD-MM-YY (ex. 09-Jun-06) into
DD/MM/YYYY, and than convert it to YYYMMDD. That’s my theory. Perhaps there
is a simpler way to do this.
First of all, check whether the values are stored as Date/Time values.
If so, you can use the Format() function in a query to get any Date/Time
formatting you want.

But your problem sounds, that your values are stored as Text. You may
use CDate() to convert them, but this may fail, if the values uses none
of the "known" Date/Time formats.


mfG
--> stefan <--
 
Back
Top