excel file to access (1 Viewer)

ponneri

Registered User.
Local time
Today, 07:00
Joined
Jul 8, 2008
Messages
102
Hi All.

I have an excel file that needs to be imported into access.

I get error when importing as one column is general type in excel, but stores mostly date values ( in dd-mmm-yyyy format.) Some of the records in that column in excel have text values like "till delivery date", "upto warranty" etc... instead of dates which is a big headache.

12-jun-17
29-sep-16
till delivery
15-oct-12
13-mar-16

How do i import into access all records as text and then use the date part in queries in access as "till delivery" needs to be printed as it is; if date does not exist.

Hope I'm clear.

Any help appreciated.
 

Gasman

Enthusiastic Amateur
Local time
Today, 02:30
Joined
Sep 21, 2011
Messages
14,265
If you are doing it manually, you can save an import specification on your first import. At that time you would specify the column type to be text not date.
 

isladogs

MVP / VIP
Local time
Today, 02:30
Joined
Jan 14, 2017
Messages
18,216
Use Cstr([fieldname]) to force import as a text string

Then when running a query do something like

Code:
 if IsDate([fieldname]) Then
...
Else
..
End If
 

ponneri

Registered User.
Local time
Today, 07:00
Joined
Jul 8, 2008
Messages
102
Hi All.

Thanks for the replies.

Will try and see. :)
 

ducouer

Registered User.
Local time
Yesterday, 18:30
Joined
Jul 14, 2017
Messages
12
@Ridders: thanks for your advice. I faced the same issue. This solved
 

Users who are viewing this thread

Top Bottom