Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Background:
I have Excel files that are not in a good 'data' format so I'm planning to migrate the data out of Excel into MS SQL server. Since the data is spread all over the place in the current Excel files, I'll need to write code to grab the right data, build a select statement, and push the data into SQL Server. Current status: I have working code that pushes the stuff I want into SQL server. Woot! Problem: The excel files contain date and time fields. The date cells have values of 39000, etc and the time fields are decimals from 0 to 1. All pretty standard. When I grab a date field using the following OLE code: TestDate = Cdat(xlSheet2.Range("D8").Value) And then display it back, I see an actual date. When I do the same thing with a time field, I just see the decimal number. Problem is that when they get to SQL server, Dates are all: 1/1/1900 12:00:00 AM Times a 1/1/1900 with what appears to be the right time. The SQL server fields are Datetime. I'm stuck - any suggestions? TIA. Doug ps - I'm going to cross post in the SQL server group. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
read data in an excel file on a remote sever | Excel Programming | |||
Excel SHOULD NOT AUTO-CHANGE formated text fields to DATE FIELDS! | Excel Worksheet Functions | |||
How to install OLE Sever | Setting up and Configuration of Excel | |||
how to get the number of days between two date formatted fields in vba for excel? | Excel Worksheet Functions | |||
Problems with Find and Date Fields in Excel macro | Excel Programming |