SqlParameter 对同一个字段大于某值,小于某值,怎么写?
比如SELECT * FROM MyTable WHERE (recordDateTime >= @recordDateTime AND recordDateTime <= @recordDateTime),
这样写sql 语句,那么SqlParameter的 name只能是一个 @recordDateTime, 不能赋两个值啊,
不用SqlParameter就很简单, WHERE( recordDateTime >= #1-1-2012# AND recordDateTime <= #2-7-2012#,
好烦
------解决方案--------------------
。。。你不会改成二个啊,
SELECT * FROM MyTable WHERE (recordDateTime >= @recordStartDateTime AND recordDateTime <= @recordEndDateTime),
或者一个参数时就改成varchar类型。
------解决方案--------------------
------解决方案--------------------
SQL code
select * from A where date between @begin_time and @end_time