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
 Transact-SQL (2000)
 Converting seconds to datetime

Author  Topic 

bgseib
Starting Member

2 Posts

Posted - 2004-10-06 : 12:42:17
I am working with a table that uses a rather odd timestamp. It is the number of seconds since 1/1/1960 + workstationId. I can truncate the workstation ID without any problem, but I am wanting to pull data off the table for a date range. If I wanted to pull only records with a datetime of 9-1-03 - 2-28-04, how could I convert the odd timestamp they have to a real date to use the date range parameters??

Thanks in advance..

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2004-10-06 : 12:50:56
SELECT Fields
FROM Table
WHERE DATEADD(second, Table.Field, '1/1/1960') BETWEEN '1/sep/2003' AND '28/Feb/2004'


Mark
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-10-06 : 12:53:33
SELECT DATEDIFF(ss,'01/01/1960','09/01/2003')


Brett

8-)
Go to Top of Page
   

- Advertisement -