what is the equivalent function of "cast (date as int)" from sqlserver to Oracle?
bensmail
Printable View
what is the equivalent function of "cast (date as int)" from sqlserver to Oracle?
bensmail
Just guessing - maybe something like (as I know almost nothing about SQL Server):
SELECT TO_NUMBER(TO_CHAR(:some_date, 'J')) FROM my_table;
in sqlserver the query cast('01/01/2005' as int) return 38382
i try ur query it returns 2453403.
I don't know how sqlserver calculate this date formel.
Bensmail
Looks like SQL Server is returning days since 01/01/1900, so I think you would just adjust for the difference between that and Julian Date base, e.g.
Code:SELECT TO_NUMBER (TO_CHAR (:some_date, 'J')) - 2415021
FROM dual;
Thank's it's work