Kirk,
You may want to check COALESCE() finction in BOL.
>In the code below, if the charge type is "I" it gets the description from the inventory file, otherwise it gets the description from the procedure file. My problem is, that they may have a manual inventory item that is not in the coInv table, in this case, the chargetype is still "I" and the description is stored in the coCaseData.ManualDesc table/field. So my question is, can anyone help me reword the case statement so that if the chargetype is I, and the Select from coInv comes back null, that I can perform the other subquery to get the proper desc. This snippit is from a stored procedure. Maybe this should portion should be done in a SQL-UDF?
>
>Thanks
>
>
>case dbo.ChargeReportLog.ChargeType
> when 'I' then (select coInv.primedesc from dbo.coinv where coinv.invid=dbo.ChargeReportLog.invID)
> else (select description from dbo.coProc where coProc.procID=dbo.ChargeReportLog.InvID)
>end as PrimeDesc
>
--sb--