Results 1 to 6 of 6

Thread: [RESOLVED] Where in sql only if not equal to <all>

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    Anchorage, Alaska
    Posts
    545

    Resolved [RESOLVED] Where in sql only if not equal to <all>

    How would I perform a Where, in a SQL command, only if the item is not equal to "<All>"

    Currently I have

    WHERE Q4.AgentGroup= [Forms]![frmCDErrorReports]![Group]

    But, the first item in the dropdown [group] is "<All>"

    Is there a way to structure the Where so it doesn't limit anything if "<All>" is selected?

    Edit 1:

    I tried
    WHERE Q4.AgentGroup= iif([Forms]![frmCDErrorReports]![Group]='<All>','*',[Forms]![frmCDErrorReports]![Group])
    hoping that the * would allow the where to grab everything, but its just comparing the two, and because no group is = * it isn't giving any results.

    Edit 2:

    Just tried this also

    Code:
    WHERE iif(Forms!frmCDErrorReports!Group='<All>','','Q4.AgentGroup=Forms!frmCDErrorReports!Group')
    Didn't work, always gets all the agent groups.
    Last edited by rack; Feb 15th, 2008 at 04:26 PM.
    Please RATE posts, click the RATE button to the left under the Users Name.

    Once your thread has been answered, Please use the Thread Tools and select RESOLVED so everyone knows your question has been answered.


    "As I look past the light, I see the world I wished tonight, never the less, sleep has come, and death shall soon follow..." © 1998 Jeremy J Swartwood

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width