MCTampa
Board Regular
- Joined
- Apr 14, 2016
- Messages
- 97
I have a small query which works in the following setup.
This identifies RESX which are not on the table DVW.
But I need the criteria to be more detailed
On my left join, I need to add:
O.UCDX = D.Size
AND O.[Check-In] = DVW.EXDTFDTF
But I can't seem to get it to work properly in the NOT IN portion of the query.
I was trying to build it out like this:
SQL:
SELECT
O.[Check In Year],
O.Cost,
O.UCDX,
O.[Area#],
O.RESX,
O.[Check-In],
O.Units,
O.[All Inclusive],
O.CMGX
From Output O left Join DVW D On
O.RESX = D.RESX
Where O.RESX NOT IN
(
Select RESX
From DVW
)
This identifies RESX which are not on the table DVW.
But I need the criteria to be more detailed
On my left join, I need to add:
O.UCDX = D.Size
AND O.[Check-In] = DVW.EXDTFDTF
But I can't seem to get it to work properly in the NOT IN portion of the query.
I was trying to build it out like this:
SQL:
SELECT
O.[Check In Year],
O.Cost,
O.UCDX,
O.[Area#],
O.RESX,
O.[Check-In],
O.Units,
O.[All Inclusive],
O.CMGX
From Output O left Join DVW D On
O.RESX = D.RESX
AND O.UCDX = D.SIZE
Where O.RESX NOT IN
(
Select RESX
From DVW
)
AND
Where O.UCDX NOT IN
(
Select UCDX
From DVW
);