Query : dynamic criteria

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wquatan
    New Member
    • Oct 2007
    • 48

    Query : dynamic criteria

    Hi,

    I have a query containing a numeric column on which a criteria is applied. The criteria-value is contained in a workfield/variable.

    So far no problem.

    Howver I would like to have the query not filtered at all when the workfield/variable contains null.

    I tried several constructions, but can't find a way to let the query return all rows in that null-situation.

    How could I do this ?

    I tried the following criteria :

    iif(isnull(work field);Like "#";workfie ld)
    iif(isnull(work field);"";workf ield)

    without luck

    Thanks
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Try Like Nz([workfield], "*") which will substitute the wildcard character (the asterisk, not the hash) if the workfield is null.

    -Stewart
    Last edited by Stewart Ross; Mar 18 '08, 09:57 PM. Reason: incorrect quotes

    Comment

    • wquatan
      New Member
      • Oct 2007
      • 48

      #3
      Thanks !!!

      Works marvellous, exactly what I was looking after !!

      Regards

      Comment

      Working...