Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count within a case

Status
Not open for further replies.
Jun 27, 2001
837
US
Looking at below, it does not error out but also does not return what we are expecting

form_ind = case when (select count(*) from fdb_medication fm1 where fm1.gcn in (select distinct fm2.gcn
from medication_payer_mstr mpm inner join
fdb_medication fm2 on fm2.ndc_id = mpm.ndc_id))
<> 0 then ' ' else '(NF)' end
 
Tim,
I'm not 100% sure but I think your problme is this line.

<> 0 then ' ' else '(NF)' end

What happens if you do this

<> 0 then 0 else '(NF)' end

- Paul [batman]
- If at first you don't succeed, find out if the loser gets anything.
 
After further review disregard that post. it's not correct.

- Paul [batman]
- If at first you don't succeed, find out if the loser gets anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top