select的問題
以下為vbsctipt語句
<%
time1=2004/1/2
time2=2004/5/2
%>
表school的字段: zhusu為bool值,time為時間日期型的值,格式為2004/2/1
我如果現在要在數据庫的表school中查找在這個時間段内性別為男的並且住宿的人的個數,
下面的語句有問題。但是把時間的限制取消就可以運行。
select count(zhusu) as aaaa from school where zhusu=true and 性別='男' and time>=time1 and time<=time2
我估計是因爲time和time1,time2的類型(他們是字符型而time是日期型)不匹配,那麽該如何改呢?