Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Inconsistent results when using OPENQUERY from MS SQL Server

user10223898Sep 22 2015 — edited Sep 22 2015

We have an MS SQL Server that has a Linked Server to our Oracle database using OleDb. This generally works pretty well, but we have a lot of issues with date related queries.

One issue I need a solution for is converting dates to Julien dates. If I execute the following on MS SQL Server:

select * from OPENQUERY(ORACLESERVER, 'select to_char(to_date(''01-JAN-2015'') ,''J'') from dual')

I get: 1721443

But if I execute the following in Oracle directly:

select to_char(to_date('01-JAN-2015') ,'J') from dual

I get: 2457024

What's up with that? And how do I fix it so I get the same result

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 20 2015
Added on Sep 22 2015
1 comment
452 views