I have the following query. The query works when I dont add the last “AND” statement with the dates. However, when I add it no results are found. I know this isnt true because I populate data into the engine and know its there. I just cant query it this way. Do you have any thoughts as to why?
SELECT *
FROM othertablename HOS
INNER JOIN tablename OBS
ON
HOS.unique_id = OBS.unique_id
WHERE (HOS.result LIKE ‘Pos%’ OR HOS.result LIKE ‘Detect%’)
AND hos.loinc IN (‘100156-9′,…’99825-2′)
AND HOS.specimen_col_dt > ’01-MAY-24’
I was expected to get rows back with data populated but I am getting nothing when I add this “AND HOS.specimen_col_dt > ’01-MAY-24′” and if I take that part away I get data
G. Sanders is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.