Log in

View Full Version : moving dates to SQL from MDB file



DBinPhilly
07-28-2009, 05:37 AM
I am converting a MDB program to an MS Project. I am importing the mdb data into SQL Server 2005.

No problem except: any date/time field comes over messed up.

I have some fields that are just dates, and some fields that are just times.

I did this about 3-4 years ago and as I recall I had to make the time only fields dates plus time on the MDB side before the import.


Is that correct and does anyone have any better solutions?

thanx

CreganTur
07-28-2009, 07:20 AM
How exactly are the dates/times messed up? Cna you provide some examples: what they look like in your Access DB, and what they look like in SQL server?

DBinPhilly
07-28-2009, 07:38 AM
An Example:

two fields: VIODATE in short date format in Access: i.e. 3/4/2000
VIOTIME in short time format in Access: i.e. 7:16

translate to: VIODATE in SQL... 3/4/2000 12:00:00 AM
VIOTIME in SQL... 12/31/1899 7:16:00 AM

My theory: combine date and time into a single field, then bring it over.

stanl
07-29-2009, 02:43 AM
My theory: combine date and time into a single field, then bring it over.

Formats refer to how data is displayed, but the basic datatype is Date/Time and is translated as such in SQL Server. If you are using Tasks/Import in SQL Server your theory is correct. If you keep things the way they are you can use Cast or Convert to display properly in SQL Server. Stan