Click here to Skip to main content
15,887,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am using SQL Server 2008R2

i am trying to write a query with multiple parameters that i will be using on a form in my project.

paramaters

@Startdate
@EndDate
@Product
@Store

Select Statement

Select * From table1 where (date >= @startdate and Date <= @enddate)
and Product = @product and Store=@Store

the problem i am having is if one of the parameters values equate to '' or null then no data will be returned.

Please could someone help
Posted

1 solution

Time to use ISNULL[^] - the link includes examples
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900