Converting partial date text to date

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

Guest

Access 2003 ~
I have inherited a table with dates displayed as text. Problem is the dates
are partial dates (i.e. 0705) 0705 is YYMM. I need to convert the text 0705
to a date 0705. I have tried a query using CDate, Format, DateSerial, in
several variations. I only need the 4 characters. Any suggestions would be
greatly appreciated!
 
B.

There is no way to represent just the year and the month in a date field.

Date fields are double precision numbers. The integer portion of the number
reflects the number of whole days since December 30th, 1899. The decimal
portion of the date represents the percentage of the day that has gone by.
As an example, at noon today, the value of the NOW() function, converted to a
double precision number would be 39121.5.

I would just continue to use the text string, unless you are trying to
compute some time difference, in which case you might try converting the year
and month and the first day of the month, or the last day of the month using
the dateserial( ) function.

HTH
Dale
 

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