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 2005 Forums
 Transact-SQL (2005)
 Time format conversion from Epoch

Author  Topic 

korssane
Posting Yak Master

104 Posts

Posted - 2009-04-06 : 16:22:01
Hi guys,
i am running an SQL querry that pulls dats from ORACLE Db. the thing is :
the time format in oracle is in epoch and i want to convert it into mmm/dd/yyyy. here is my code but i am still keep getting error :
CREATE_DATE is the field in epoch format.

SELECT * FROM OPENQUERY(LINKED_ORA,
'SELECT
TROUBLEID,
CREATE_DATE,
DATEADD(ss,CAST(CREATE_DATE AS int), ''01/01/1970'')AS CREATEDATE
FROM CLIENT_TROUBLE
WHERE CREATEDATE between ''01/01/2009'' AND ''01/02/2009''');
GO

any help will be greatly appreciated
thaks

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-04-06 : 17:32:50
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=122702

<><><><><><><><><><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page
   

- Advertisement -