rabbit75
Programmer
- Aug 15, 2002
- 30
I am sure this type of question has been answered before, but the search does not seem to be working for me.
The end user can enter values for a Beginning vendor and an Ending vendor - enter both (beginning and ending), enter one (beginning or ending) or leave both blank. Am trying to write a stored procedure passing in the beginning and ending values. Is there a way to write it to return the results so that:
if beginning = '' and ending = '', select all
if beginning <> '' and ending = '', select for vendor >= beginning
if beginning = '' and ending <> '', select for vendor <= ending
if beginning and ending <> '', select for between beginning and ending
or will I need to write multiple stored procedures?
Thank you,
rabbit75
The end user can enter values for a Beginning vendor and an Ending vendor - enter both (beginning and ending), enter one (beginning or ending) or leave both blank. Am trying to write a stored procedure passing in the beginning and ending values. Is there a way to write it to return the results so that:
if beginning = '' and ending = '', select all
if beginning <> '' and ending = '', select for vendor >= beginning
if beginning = '' and ending <> '', select for vendor <= ending
if beginning and ending <> '', select for between beginning and ending
or will I need to write multiple stored procedures?
Thank you,
rabbit75