Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hh:nn:ss format problem on import text file 1

Status
Not open for further replies.

kentwoodjean

Technical User
Oct 19, 2002
376
US
I currently import data from a text file (csv). One column of data records hours, minutes and seconds that a person performed an activity. If I simply import and leave my data type on my table as "text", it shows the time as AM. In the format field of my table, I have indicated hh:nn:ss, and whether I show "text" or "date/time" as my data type, it will format correctly but will not pick up a 2 digit number in the hour field if those hours exceed 24. In other words, it only picks up one digit, leaving the other as a 0. How can I correct this problem, while still showing simply hours, minutes and seconds. As an example:

Text file entry: 21:03:06
Access import: 21:03:06

Text file entry: 43:10:16
Access import: Type Conversion Error is received.
 
If you format as
Code:
hh:nn:ss
then access expects a 24-hour time and so objects for anything else. I suggest you store it in a simple text field with no formating at all. Otherwise you can process this data and extract the number of days for more than 24 hours and sore it in a different number field but it gets complicated...
 
Thanks for your response. It worked just fine using Text with no formating. Problem is, table initially set up using download from Crystal reports to Excel and then to Access. With that, there was no way it would work without the hh:nn:ss. This was before I got access to the actual Text files. With this new method of importing, I assumed I would need to continue using the 24 hr formatting. Now, as you say, no formating is necessary.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top