我的数据库是有年月日时分秒,我现在要实现选择一个年和月则这个年月的所有的纪录都出现。还可以修改,然后我按“确定”则把修改后的数据又写入数据库中。
參考答案:time1="'"&trim(Request.Form("month1"))&"-"&trim(Request.Form("day1"))&"-"&trim(Request.Form("year1"))&"'"
time2="'"&trim(Request.Form("month2"))&"-"&trim(Request.Form("day2"))&"-"&trim(Request.Form("year2"))&"'"
select * from 表名 where date between "&time1&" and "&time2&"
要是取整个月,就把day1/day2设为1,month2设为month2+1