We have an Oracle database that we access through OpenQuery for some stuff. You apparently can\'t do date comparisons directly in OpenQuery using the OleDB driver, so to get aro
I found a solution to the problem. By specifying a mask for the date, it will provide the proper results. Using:
to_char(to_date('01-JAN-2015','DD-MON-YYYY') ,'J')
instead of
to_char(to_date('01-JAN-2015') ,'J')
Gives the same result through OpenQuery and directly from Oracle.