Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Friends,

I am developing a windows application fro which I have developed a form through

which user can upload an excel file data to sql server 2005 Table.

The problem is that the values in Excel File for Gross_TurnTime is in HH:mm format

but when I upload the data to sql server I see the data in numbers i.e 103,569 etc

How can I get the original time format from this data in sql server 2005.

I.e 101 in HH:mm format in Sql server 2005.

Thank you in Advance for your urgent reply,

Regards,
Kishor
Posted
Comments
[no name] 9-Nov-11 8:08am    
What is data type of the column you are inserting into? How are you inserting it?

Don't ask for an urgent reply. It rude. This is a volunteer site and people will answer on their time not yours

1 solution

Date/Time values in Excel are held as real numbers where the value before the decimal separator is the date and the value after is the time. You need to convert these values to DateTimes and store as such in the database. Don't store them as character strings since you are then forced to display them in only one format which may not match the standard for some parts of the world. See here[^] for a full description.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900