I want to write an select query using OPENQUERY in SQL server where i have to select the records from linked server but in where clause i have to compare the dates but the date should be from a table present in current DB not in linked server DB. For example: Select * from OPENQUERY(Linked_Server,'select * from db.table_name where Edate>(select edate from CurrentDB)')
so please help me how in can pass the parameters from current Database server to linked Database server