(@Date1 IS NULL OR (@Date1 IS NOT NULL AND
Date1>=
@Date1)) AND
(@Date2 IS NULL OR (@Date2 IS NOT NULL AND
Date2 <=
@Date2))
)
Because when the page load, the datepicker doesn't choose any value
For division or lieu, I just pass the default value to 'NULL' and it works,
For DateTime I can't pass the default value to 'NULL' because it's not a string, so I used the " IS NULL": It's working on Test but not working when loading the page
salim20001
Member
154 Points
507 Posts
Re: SQL Statement error
May 02, 2012 11:07 AM|LINK
This is the problem :
Because when the page load, the datepicker doesn't choose any value
For division or lieu, I just pass the default value to 'NULL' and it works,
For DateTime I can't pass the default value to 'NULL' because it's not a string, so I used the " IS NULL": It's working on Test but not working when loading the page