I am currently using this statement to query a linked Server:
INSERT INTO WOMAST01
SELECT * FROM OPENQUERY(ATQAV, 'SELECT * FROM WOMAST01')
Open in new window
and it works fine.
I want to add a WHERE clause to filter by date using the RECDATE field. I try
INSERT INTO WOMAST01
SELECT * FROM OPENQUERY(ATQAV, 'SELECT * FROM WOMAST01 WHERE RECDATE > '20140101'')
Open in new window
but it is not working, error received: Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '20140101'.
What is the correct syntax?