Access 97 Date Time

  • Thread starter Thread starter John Stech
  • Start date Start date
J

John Stech

Date fields are in general number format and to convert
them I am having to go through several steps. I was
hoping someone had a suggestion or perhaps a function I
can define. The date is coming to me as 20030102 in
number format. Currently I am using a query to take it
apart.
I use mid right and left funtions and then I recombine it
using [2003]&"/"&[01]&"/"&[02]. This way I go from
20030102 as a number to 01/02/2003 as text. Any
suggestions. This works but is time intensive and the
files are very large.
 
Date fields are in general number format and to convert
them I am having to go through several steps. I was
hoping someone had a suggestion or perhaps a function I
can define. The date is coming to me as 20030102 in
number format. Currently I am using a query to take it
apart.
I use mid right and left funtions and then I recombine it
using [2003]&"/"&[01]&"/"&[02]. This way I go from
20030102 as a number to 01/02/2003 as text. Any
suggestions. This works but is time intensive and the
files are very large.

The important part is the field's datatype, not it's format.
If the field is a Date DataType field, not a Number Datatype, just
write:
mm/dd/yyyy
in the Format property line.

If the field is actually a Number datatype
look up the DateSerial() function in VBA help.
DateSerial(YearValue,MonthValue,DayValue)
 
Back
Top