Select * from order as o
where (@datefrom is null or @dateto is null
or o.orderdate between @datefrom and @dateto)
or (@datefrom = o.orderdate)
我想使用datefrom
和dateto
參數的日期範圍的選擇或我可以在datefrom
參數類型日期等01.06.2014
,在這種情況下dateto
將null
。具有兩個日期時間範圍參數,其中條件
這意味着我想爲兩個過濾器使用datefrom
參數,但是當我在datefrom
參數和dateto is null
中輸入特定日期時,根據類型日期數據不正確。
請幫助解決這個問題。