• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Converting a script to sql server

fallenangel99

Golden Member
hello,

i have the following script written for oracle and looking to have it work in SQL Server. I looked online and could not find a NUMTODSINTERVAL equivalent for SQL Server


select x,y,

TO_DATE('19700101000000','YYYYMMDDHH24MISS') + NUMTODSINTERVAL((deliveredtime/1000),'SECOND') deliveredtime,

from z
where c order by deliveredtime

deliveredtime is stored as numberic type in SQL Server

Thanks much
 
What are you trying to do? I'm not up on Oracle but should be able to tell you once I know what you are trying to accomplish.
 
You're adding an interval expressed as a number of seconds to a date, I think. You can accomplish the same thing using SQL Server's date functions. You'll just have to express the logic a little differently.
 
Originally posted by: nickbits
What are you trying to do? I'm not up on Oracle but should be able to tell you once I know what you are trying to accomplish.

Hi,

I am trying to convert the number stored in the database to YYYY MM DD HH MM SS format.

Thanks
 
So is Delivered time a time unit that needs to be added to 1/1/1970 to come up with the delivered datetime in your specified format?

SELECT DateAdd(ss, DeliveredTime, '1/1/1970') As DeliveredDateTime

 
Back
Top