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)
 Time Data Type

Author  Topic 

dimmil
Starting Member

4 Posts

Posted - 2005-08-17 : 17:57:29
The outline of my task is to import csv files in sql table and then using reporting services create reports.
My problem is that values in csv files have the following time format xx:xx:xx or sometimes xxx:xx:xx where x=0,1,2...9. For example 122:59:59 which means 122 hours, 59 minutes, 59 secs.
I couldn't find any suitable data type field, so something else must be done.

Cheers

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-08-17 : 18:00:36
Datetime is what you'll need to use. Then from your report, you can remove the date portion using DateFormat function.

Tara
Go to Top of Page

dimmil
Starting Member

4 Posts

Posted - 2005-08-17 : 23:34:33
Thanks Tara I'll give a try
Go to Top of Page

byrmol
Shed Building SQL Farmer

1591 Posts

Posted - 2005-08-17 : 23:50:03
I think you are after a Time Span data type not a Time Point data type.

SQL Server 2000 only has time point data types... so you are going to have to be creative...
Perhaps you could make a function/or view that converts it to seconds...


--throws an error... sql is expecting the hour portion to be less than 24
select CAST('122:23:23' as datetime)
--convert to seconds
select (122 * 60 * 60) + (23*60) + 23


DavidM

A front-end is something that tries to violate a back-end.
Go to Top of Page

dimmil
Starting Member

4 Posts

Posted - 2005-08-19 : 00:54:46
Unfortunately, datetime data type can't be used because sql expects the hour portion to be less than 24. In my case usually is greater than 24
Go to Top of Page
   

- Advertisement -