10 Replies Latest reply: Feb 11, 2013 10:13 AM by Chris Young RSS

    using an if statement inside  'where'

      HI i need a little help here.

       

      Basically I have a variable called owner and I want to use this inside a where clause, however I only want to include this if there is something inside the variable.

       

      At the minute I am using this which is including it regardless of whether there is anything inside owner or not.

       

           FROM REP_TASK_NF WHERE CANCELLED_DATE = '' AND OWNER = '$(owner)'

       

      I need it to only use owner if it IS NOT NULL, how do i do this?

       

      Thanks