timscronin
MIS
I have the below where clause on a select
where substring(pa.other_id_number,5,1) = @monthid
and pa2.df_patstatus like 'act%'
and ((pa2.df_institutionname not like ('ACT%')
or pa2.df_institutionname not like ('county%')))
It returns records that have either one of the not like statements. If I comment out the line and use below it will work for one of the statements
where substring(pa.other_id_number,5,1) = @monthid
and pa2.df_patstatus like 'act%'
and pa2.df_institutionname not like ('ACT%')
How can I get the two to work together. I thought the parenthesis would work but no luck.
where substring(pa.other_id_number,5,1) = @monthid
and pa2.df_patstatus like 'act%'
and ((pa2.df_institutionname not like ('ACT%')
or pa2.df_institutionname not like ('county%')))
It returns records that have either one of the not like statements. If I comment out the line and use below it will work for one of the statements
where substring(pa.other_id_number,5,1) = @monthid
and pa2.df_patstatus like 'act%'
and pa2.df_institutionname not like ('ACT%')
How can I get the two to work together. I thought the parenthesis would work but no luck.