Hi, I have 2 tables:
tblStations StationID
Station
tblStationUser RecordID
UserName
Station
I'm trying to come up with a dataset that contains the
tblStations.Station
EXCEPT for where that Station exists in tblStationUser where the
UserName = @varUserName.
I've tried this but get 0 rows (I should get about 40):
SELECT tblStations.Station
FROM tblStations
WHERE NOT EXISTS
(SELECT tblStationUser.Station FROM tblStationUser WHERE
tblStationUser.UserName=@varUserName)
ORDER BY Station
I tried the subquery separately which returns the correct number of
rows.
Any clues as to where I'm going wrong?
Thanks!
Kathy