![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
In Access 2000 and 2002, I have created an import specification to import the fixed-width recordset below into an existing table. I am having strange problems with the import of the date and time fields. 177 102003 16:43:12 102003 18:43:12 6OAG0ADP Y 0000 0000 0000 0000 61930 4HGA800 165 102003 17:43:12 102003 18:44:12 6OAG0ADP Y 0000 0000 0000 0000 61930 4HGA800 177 102003 16:41:18 102003 18:45:12 6OAG0ADP Y 0000 0000 0000 0000 61930 4HGA800 118 102003 16:41:17 102003 18:46:12 6OAG0ADP Y 0000 0000 0000 0000 61930 4HGA800 104 102000 16:29:50 102000 18:47:12 00000000 N 0000 0000 0000 0000 61930 4HGA800 130 102000 16:29:56 102000 18:43:12 00000000 N 0000 0000 0000 0000 61930 4HGA800 104 102000 16:28:56 102000 16:38:56 00000000 N 0000 0000 0000 0000 61930 4HGA800 The table design is as follows(there are no key restraints): FLT Integer STDATE DATE/TIME SHORTDATE STTIME DATE/TIME LONGTIME NDDATE DATE/TIME SHORTDATE NDTIME DATE/TIME LONGTIME BattID Text(9) C Yes/No NFO1 Text(4) NFO2 Text(4) NFO3 Text(4) NFO4 Text(4) CHGID Long Integer VehicleID Text(9) The import specification's Dates, Times, and Numbers selections are: Date Delimeter = no delimeter Time Delimeter = : Four Digit Years = unchecked Leading Zeros in Dates = checked With the above values selected in the Import Spec., the STTIME and NDTIME fields fail the import and the STDATE and NDDATE fields import correctly. If I change the import spec. values for dates, times, and numbers to: Date Delimeter = / Time Delimeter = : Then the STDATE and NDDATE fields fail the import and the STTIME and NDTIME fields import correctly. This makes no sense to me why the date delimeter has to be set with "/" for the Time Delimeter to work. I have tried recreating the import spec. and everything else I can think of and nothing seems to work. I removed the date formats on the table as a test but it did not help. I also imported to a new table using the import spec but the date or time fields would fail the import. Am I missing something or is this software not going to work? |
#3
| |||
| |||
|
|
The problem appears to be with the date format. I could only get it to work properly by first munging your date data in the file from 102003 to 10/20/03 and then setting the date delimeter to / at which point it imported properly. Is munging your date format a reasonable step? Any macro enabled editor could do it, or a fairly simple procedure to read from the file, split each line on spaces into an array, then taking the date elements and adding the foreslashes. I can help you with this if need be. -John mark <ms (AT) nospam (DOT) comcast.net> wrote In Access 2000 and 2002, I have created an import specification to import the fixed-width recordset below into an existing table. I am having strange problems with the import of the date and time fields. 177 102003 16:43:12 102003 18:43:12 6OAG0ADP Y 0000 0000 0000 0000 61930 4HGA800 165 102003 17:43:12 102003 18:44:12 6OAG0ADP Y 0000 0000 0000 0000 61930 4HGA800 177 102003 16:41:18 102003 18:45:12 6OAG0ADP Y 0000 0000 0000 0000 61930 4HGA800 118 102003 16:41:17 102003 18:46:12 6OAG0ADP Y 0000 0000 0000 0000 61930 4HGA800 104 102000 16:29:50 102000 18:47:12 00000000 N 0000 0000 0000 0000 61930 4HGA800 130 102000 16:29:56 102000 18:43:12 00000000 N 0000 0000 0000 0000 61930 4HGA800 104 102000 16:28:56 102000 16:38:56 00000000 N 0000 0000 0000 0000 61930 4HGA800 The table design is as follows(there are no key restraints): FLT Integer STDATE DATE/TIME SHORTDATE STTIME DATE/TIME LONGTIME NDDATE DATE/TIME SHORTDATE NDTIME DATE/TIME LONGTIME BattID Text(9) C Yes/No NFO1 Text(4) NFO2 Text(4) NFO3 Text(4) NFO4 Text(4) CHGID Long Integer VehicleID Text(9) The import specification's Dates, Times, and Numbers selections are: Date Delimeter = no delimeter Time Delimeter = : Four Digit Years = unchecked Leading Zeros in Dates = checked With the above values selected in the Import Spec., the STTIME and NDTIME fields fail the import and the STDATE and NDDATE fields import correctly. If I change the import spec. values for dates, times, and numbers to: Date Delimeter = / Time Delimeter = : Then the STDATE and NDDATE fields fail the import and the STTIME and NDTIME fields import correctly. This makes no sense to me why the date delimeter has to be set with "/" for the Time Delimeter to work. I have tried recreating the import spec. and everything else I can think of and nothing seems to work. I removed the date formats on the table as a test but it did not help. I also imported to a new table using the import spec but the date or time fields would fail the import. Am I missing something or is this software not going to work? |
#4
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |