View Single Post
  #3 (permalink)  
Old December 14th, 2011, 07:07 AM
Squire11 Squire11 is offline
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, I have a form with 2 fields. one is a date, the other a varchar2.
Now a user can either select 1 of the 2 or both of the 2. I want to
submit the users' selection as a query. If only 1 filed is selected,
then the proper column/field in the db will be compared against that
field. If both fields are selected, I need to use an AND statement so
that both fields from the database will be compared against what the
user submitted.
I was thinking of using a case statement in the where clause, but
unsure if this is the best approach.