ASP 日期问题
是这样的
select * from TAB_fhqk where 日期>=#2006-"&month1&"-01# and 日期<=#2006-"&month1&"-30# order by 日期 asc
这样就漏了31号的生产
可如果我改成31的话 8月没问题 9月就会出错
请问各位有什么方法可以解决呢?
参考答案:换个思路
后面的那日期#2006-"&month1&"-30# 换成下个月1号的前一天
即 当月一号加一个月再减一天
-----------------------------------
select * from TAB_fhqk where 日期>=#2006-"&month1&"-01# and 日期<= DateAdd (day,-1, DateAdd (m,1, #2006-"&month1&"-01#) order by 日期 asc