Importing date/time fields to MS Access

  • Thread starter Thread starter vikash.verma
  • Start date Start date
V

vikash.verma

Hi,

I have a record containing a Date field and a Time field.

The file has records as given below:

Date, Time

20030822,174747

20030823,094747


When I try to import these values into an Access table, I get errors and the
table is empty. I have defined the DataTypes for both these fields as
Date/Time . I tried all the formats provided by Access for both the Date and
Time fields. It does not work.

I also use an import specification where I don't specify a delimiter like
'/' for date or ':' for time. Even then it does not work.

How do I import these fields ?

Thanks,

Vikash
 
vikash:

You're cross posts are really a bit excessive. Access.modulesvbadao would
have been sufficent.

That data you are importing is not really "valid" date time data, its simply
a string. What you need to do is to import it into an intermediate text
field, and then use an update query, parsing the string up into its
consituent parts using left, right and mid functions and turn those strings
into acceptable date formatted strings and then call the DateValue and
TimeValue function to turn it into an actual date type of data. DateValue
and Time value can be additive so that as an example if you run the
following in the immediate window:

?DateValue(Now()) + TimeValue(Now())

If returns a full date time of

3/19/2004 8:16:17 AM
 
Back
Top