【发布时间】:2013-09-16 15:57:13
【问题描述】:
我想在between two dates 中传递check date 或者可以传递为NULL
使用存储过程
代码
declare @fromDate date = null
declare @toDate date = null
select * from Mytable
where date betweeen @fromDate and @toDate OR NULL (how to check for both parameters)
我还有另外 2 个参数,所以应该显示与日期无关的结果。 如果@todate 和@fromDate 为NULL
请帮忙。
【问题讨论】:
-
如果@toDate 为空,你需要什么结果?
-
我还有另外 2 个参数,所以应该显示与日期结果无关的参数
标签: mysql sql sql-server tsql