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;
Jurij Modic ASCII a stupid question, get a stupid ANSI 24 hours in a day .... 24 beer in a case .... coincidence?
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;
SELECT TO_NUMBER (TO_CHAR (:some_date, 'J')) - 2415021 FROM dual;
Last edited by padders; 03-07-2005 at 06:24 AM.
Thank's it's work
Forum Rules