AnsweredAssumed Answered

IsEmpty statement within an ExecuteSQL?

Question asked by ezeitgeist on Jan 4, 2017
Latest reply on Jan 4, 2017 by philmodjunk

I have been using an SQL Calculation for a field that has been working well. I just ran into a situation when one of the fields in the SQL equation needs to change based on if one field is empty. Here is a more specific reference:

 

ExecuteSQL ( "SELECT COUNT ( CountRef ) FROM \"Connections\" WHERE \"UserID\"=? AND \"Booked it\"=? AND IT_Audition=? AND \"Top worn Callback\"=?" ; "" ; "" ; $$UserID ; 1 ; 1 ; "dress" )

 

The situation is that IF the "Top worn Callback" field is EMPTY, then I want it INSTEAD to use the "Top worn" field (they are two different fields in the "Connections" table). Both the "Top worn Callback" and "Top worn" field would still have the same item it is searching (in this case "dress").

 

How do I add the "IsEmpty" aspect into the ExecuteSQL? Would I replace \"Top worn Callback\" with ( IsEmpty ( Connections::Top worn Callback ; "\"Top worn\"" ; "\"Top worn Callback\"") ) ?

Outcomes