If there is no location in the Records table that matches a location in Records_Locations, how do I make a message display to indicate that? I though below would work, but obviously I'm off.
SELECT DISTINCT Records_Locations.Location_Code,
Records.opendate,
Records.tkloc,
CASE
WHEN Records.tkloc IS null
THEN Records_Locations.Location_Code
ELSE Records.tkloc
END AS Location
FROM Records_Locations
LEFT OUTER JOIN Records ON Records_Locations.Location_Code = Records.tkloc
WHERE Records.opendate = '9/6/2011'
Thanks for any help.
SELECT DISTINCT Records_Locations.Location_Code,
Records.opendate,
Records.tkloc,
CASE
WHEN Records.tkloc IS null
THEN Records_Locations.Location_Code
ELSE Records.tkloc
END AS Location
FROM Records_Locations
LEFT OUTER JOIN Records ON Records_Locations.Location_Code = Records.tkloc
WHERE Records.opendate = '9/6/2011'
Thanks for any help.