Hi, I am new to Sybase environment. I am trying to write a stored proc which takes 2 parameters "From" and "To". Then it does a "search" for records wich fall into the range specified by From and To. I using a query which has the following basic structure:
where field1 BETWEEN From AND To
Now, if From and To are Null, that is I don't provide a value for these two parameters, I want that the query should return all records
from the database. In this case, I set From and To to a min and max value, and that works out to be just fine. But, if Field1 is Null for one record, I don't get a result at all.
In short, I want to get all records falling in a range if a range is provided, and if a range is not provided, I want a full table listing.
Now, to keep things simple, I just used one range here. In my stored proc, I have about 10 ranges.
An early response would be greatly appreciated.
Thanks a lot