importing excel sheet (with date field) to access database

  • Thread starter Thread starter grachee
  • Start date Start date
G

grachee

how do i retain the date format of the excel sheet upon
importing it to an access database? For example there is 1
column in excel worksheet A that stores a date value.
After importing it to Access, the date is converted into
numerical values even after I changed the format of the
date field in design view.
 
-----Original Message-----
how do i retain the date format of the excel sheet upon
importing it to an access database? For example there is 1
column in excel worksheet A that stores a date value.
After importing it to Access, the date is converted into
numerical values even after I changed the format of the
date field in design view.

.

gfhjfgluy
 
Grachee

Design your in your database a temp table using text characters set to +/-30 -50 on all fields. This, should be your target table for the data import process. Once imported, create a working table with the respective fields set to "date", date and time, or whatever other data field types you need. Then, build a query where in you drop the temp table, then, here you'd use the CDate([MyDate]) function to convert the data in the temp table into an actual date and the other fields to whatatever they need to be. Once done, this same query can be used as an appaend query, in the "append from" part of the append query, then, point the "append to" part of the query to your working table. With this phase completed, you can use a button running the append process (via the DoCmd.RunQuery "MyAppend" or a macro "Macro RunMyAppaned") to complete the process if it needs to done repeatedly

Hope this helps,..

----- grachee wrote: ----

how do i retain the date format of the excel sheet upon
importing it to an access database? For example there is 1
column in excel worksheet A that stores a date value.
After importing it to Access, the date is converted into
numerical values even after I changed the format of the
date field in design view.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top