主题:关于时间段的查询
xm7050432
[专家分:180] 发布于 2009-01-13 15:37:00
[img]http://imgqun.qq.com/cgi-bin/img?uuid=2088a4a42c51bdc78f83692c7a24924648[/img]
想把某段时间的记录挑出来。但是老是提示错误。
请各位老师给点意见。
查询按钮的代码大概如下:
LOCAL ks,js
ks="^"+aLLTRIM(thisform.text6.Value)
js="^"+ALLTRIM(thisform.text1.Value)
SELECT * from clxx where 采集日期 BETWEEN {ks} AND {js}
我知道如果写成:SELECT * from clxx where 采集日期 BETWEEN {^2007-08-10} AND {^2008-05-08},就不会提示错误,但不知道如何用变量代替。请各位帮忙谢谢。
回复列表 (共5个回复)
沙发
fyyylyl [专家分:8550] 发布于 2009-01-13 15:49:00
SELECT * from clxx where BETWEEN(采集日期,ks,js)如何?
板凳
qjbzjp [专家分:8830] 发布于 2009-01-13 16:28:00
试试:
SELECT * from clxx where 采集日期 BETWEEN {&ks} AND {&js}
3 楼
qjbzjp [专家分:8830] 发布于 2009-01-13 16:29:00
4 楼
xm7050432 [专家分:180] 发布于 2009-01-13 16:52:00
[quote]试试:
SELECT * from clxx where 采集日期 BETWEEN {&ks} AND {&js}
[/quote]
可以啦,谢谢啊。呵呵
5 楼
qjbzjp [专家分:8830] 发布于 2009-01-13 16:57:00
不行再试试:
SELECT * from clxx where 采集日期 BETWEEN ks AND js
我来回复