Convert data type in query

  • Thread starter Thread starter Juana
  • Start date Start date
J

Juana

I have used the Left() function to return 6 numberic
characters from a text field. (IE: Left([Batch#],6).
Can this now be formatted as a date data type? Is so,
how? Thanks - Juana
 
Juana

?6 character date -- can you give an example?

Take a look at the DateSerial() function in Access HELP -- you will probably
be using the Left(), Mid() and Right() functions, too.
 
Assuming your Batch# field contains yymmdd, you could type this into the
Field row of a query:
DateSerial(Left([Batch#],2), Mid([Batch#],3,2), Right([Batch#],2))
 
-----Original Message-----
I have used the Left() function to return 6 numberic
characters from a text field. (IE: Left([Batch#],6).
Can this now be formatted as a date data type? Is so,
how? Thanks - Juana
.
try this

CDate(Left([batch#],2) & "/" & Mid([batch#],3,2) & "/" &
mid([batch#],5,2))
 
Back
Top