Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 How to insert datetime (datatype) from CSV file to tables.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-12-18 : 09:05:24
N Rajesh writes "How to insert datetime(data) from CSV file to sql tables and retrieve only the time value.

I am able to insert datetime into the sql tables, but the sql table adds my time value as date and displays date value only."

robvolk
Most Valuable Yak

15732 Posts

Posted - 2001-12-18 : 09:32:38
First, you should INSERT the full datetime value, you can always extract any portion of the date or time using the DatePart() and DateName() functions, as well as CONVERT():

SELECT Convert(char(8), dateColumn, 108) FROM myTable --will display only the time

Read Books Online for the 3 functions listed above, you'll be pleasantly surprised what these and other functions can do with datetime values.

Go to Top of Page
   

- Advertisement -