By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,506 Members | 2,282 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,506 IT Pros & Developers. It's quick & easy.

Import Date field

P: n/a
I have a delimited text file that has a column of dates in the form
2003-10-11 10:24:53. I can't get past a type conversion error when
atempting to import this into a date/time column.

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Import the data to a temp table that has that date/time column set as
a Text data type. Run a query to change the data to a date. E.g.:

UPDATE temp_table
SET time_col = CDate(Format(time_col, "m/d/yy hh:nn:ss"))
WHERE time_col Is Not Null

Then append the data from the temp_table to your working table(s).

Some of the data in the "time_col" may not be valid date data types.
You can write another query to delete those values. Hint: use the
IsDate() function.

See the Access Help articles "Format Function," "Type Conversion
Functions" and "INSERT INTO Statement."

- --
MGFoster:::mgf
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP5lslIechKqOuFEgEQJ+dwCeJl0atvokL0FGX3jLaqf1Eg GkJ/cAoKLU
P1htTu4kuUmbzVECxdicuYkj
=elS9
-----END PGP SIGNATURE-----

michael montagne wrote:
I have a delimited text file that has a column of dates in the form
2003-10-11 10:24:53. I can't get past a type conversion error when
atempting to import this into a date/time column.


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.