@FromDate datetime = null
@ToDate datetime = null
SELECT * FROM TABLE
WHERE ....
AND [PI].Date BETWEEN @FromDate AND @ToDate
When any date is null, the records are not displayed. What is the correct syntax so that I can get all records if any of the dates are null.
I have thought of this:
@FromDate datetime = '01/01/1901',
@ToDate datetime = '12/31/9999'
Thanks.