IIF in Access, DECODE in Oracle, ? in SQL

  • I am working with an app that I just upsized from Access.  Some of my queries have an IIF statement in it and none of them upsized.  In Oracle, I use DECODE and/or NVL statements to get similar results.  What could I use in SQL to do "if" logic?

    TIA! Kay

  • I just found the CASE statement in one of your other forums and it seems to be exactly what I was looking for!

    CASE WHEN dbo.tblPatient.City IS NULL THEN NULL WHEN dbo.tblPatient.City = '' THEN NULL ELSE dbo.tblPatient.City + ', ' + dbo.tblPatient.State + ' ' + dbo.tblPatient.Zip END

    What a great site this is!

    Kay

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply