OPENQUERY Problem
Hi,
I have created a linked server to oracle.
I executed the query as
SELECT @Counter = count(*) from OPENQUERY([TIE DB], 'select * from ora_owner.appointment where update_dtm > to_date(''2007-oct-11 18:06:05'',''yyyy-mon-dd HH24:Mi:SS'')')
Its executing fine.
But I want to get the date from another table from my sql server.
How can I form the OPENQUERY with a variable(contains date)?
SELECT @Counter = count(*) from OPENQUERY([TIE DB], 'select * from tie_owner.rtt_appointment where update_dtm > to_date(''+ @ApptLastUPdateDateTimee + '',''yyyy-mon-dd HH24:Mi:SS'')')
This statement is giving error...
Incorrect sysntax at +
How do I get date in yyyy-mmm-dd hh:mm:ss format?
The same date I will form in the openquery.
This is struggling me a lot. Pls suggest an idea.
Thanks in advance
|