SQLTeam.com | Weblogs | Forums

Pooling data from Oracle to SQL through Linked Server

I try running this query in SQL Server

SELECT * FROM OPENQUERY(ORACLE,
'Select * from Transact WHERE tra_date between
TO_DATE(''2018-12-01'', ''YYYY-MM-DD'')
AND TO_DATE(''2019-01-21'', ''YYYY-MM-DD'')
AND LED_CODE between (8000 and 9999)'
)
But I keep receiving these errors..

OLE DB provider "OraOLEDB.Oracle" for linked server "ORACLE" returned message "ORA-00907: missing right parenthesis".
Msg 7321, Level 16, State 2, Line 8
An error occurred while preparing the query "Select * from Transact WHERE tra_date between
TO_DATE('2018-12-01', 'YYYY-MM-DD')
AND TO_DATE('2019-01-21', 'YYYY-MM-DD')
AND LED_CODE between (8000 and 9999)" for execution against OLE DB provider "OraOLEDB.Oracle" for linked server "ORACLE".
Can anyone help me please.

greetings,

maybe change this
AND LED_CODE between (8000 and 9999)

to AND LED_CODE between 8000 and 9999

?