K
kmr
I need to build a query that accepts input from a MS
Access Project - this works fine for one variable... but I
need to be able to accept multiple values for a field...
for example, I have variables called @animal1,
@animal2 ... @animal5
I need to make a query that says
where animal = @animal1 or animal = @animal2 or animal =
@animal3 if three were supplied - or
where animal = @animal1 or animal = @animal2 if two
variables were supplied -
I can't figure out how to construct the sql query if the
number of values is dynamic I tried using a basic If...
else with a begin and end but it appears you can't say
something like if (@animal1 is not null and @animal2 is
not null) begin ... end else if ...
Any suggestions/ideas greatly appreciated. thank you.
-kmr
Access Project - this works fine for one variable... but I
need to be able to accept multiple values for a field...
for example, I have variables called @animal1,
@animal2 ... @animal5
I need to make a query that says
where animal = @animal1 or animal = @animal2 or animal =
@animal3 if three were supplied - or
where animal = @animal1 or animal = @animal2 if two
variables were supplied -
I can't figure out how to construct the sql query if the
number of values is dynamic I tried using a basic If...
else with a begin and end but it appears you can't say
something like if (@animal1 is not null and @animal2 is
not null) begin ... end else if ...
Any suggestions/ideas greatly appreciated. thank you.
-kmr