How do I selectively get rid of portions of the where clause based on user entry

  • Set a default value for the (@office) office parameter to something like "N/A" and then change your query to...

    Select Date, Office, Name from Info_table

    Where Date >= '01/01/2007' and

    Date <= '02/01/2007'

    and (Office = @office OR @office = 'N/A')

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • Ok. That works, although I'm not sure I understand how. What if I have another senerio where there are multiple entries for office like:

    Where Date >= '01/01/2007' and

    Date <= '02/01/2007'

    and Office in ('Office_A','Office_B')

    How do I eleminate the "and Office in() " when none are selected by the users. BTW thanks for you previous answer.

  • I'm not sure with the multi-select parameter feature in RS 2005.

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg

Viewing 3 posts - 1 through 4 (of 4 total)

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