Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

OpenQuery Where Clause Error!!!

$
0
0

I have 2 openquery statements that I'd like to filter without doing a subquery.  How can I do this? the Where Clause is giving me trouble.

--I want to join these 2 statements and filter by the where clause at the bottom within 1

-- OPENQUERY Clause

SELECT *

   FROM OPENQUERY (ORDERSVR,'Select * From Global.dbo.GlobalOrders')

SELECT *

   FROM OPENQUERY (ORDERSVR,'Select * From Global.dbo.GlobalOrderItems')

--The Where Clause is based on local Variables

WHERE StartDate >= @StartDate and EndDate <= @EndDate


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>