2005-11-30 = 2005-11-30 00:00:00select thread_title,threadID from JB_thread where postuserid=428 and (posttime BETWEEN #2005-11-01 00:00:00# and #2005-11-30 23:59:59#)
select thread_title,threadID from JB_thread where postuserid=428 and (posttime BETWEEN #2005-11-01# and #2005-12-1#)
对,应该是时间部份造成的select thread_title,threadID from JB_thread where postuserid=428 and posttime >= #2005-11-01# and posttime < #2005-12-1#
select thread_title,threadID from JB_thread where postuserid=428 and convert(varchar(8),posttime,120) >= #2005-11-01# and convert(varchar(8),posttime,120)< #2005-12-1#
select thread_title,threadID from JB_thread where postuserid=428 and (posttime BETWEEN #2005-11-01# and #2005-11-30#)这句里面的#2005-11-30# 系统自动将它理解为 2005-11-30 00:00:00.000所以<=2005-11-30 00:00:00.000 自然就没有2005年11月30日的数据了。
select thread_title, threadID from JB_thread where postuserid=428 and posttime> #2005-10-31# and posttime< #2005-12-01#
and posttime >= #2005-11-01#
and posttime < #2005-12-1#
and convert(varchar(8),posttime,120) >= #2005-11-01#
and convert(varchar(8),posttime,120)< #2005-12-1#
系统自动将它理解为
2005-11-30 00:00:00.000所以<=2005-11-30 00:00:00.000 自然就没有2005年11月30日的数据了。
threadID
from JB_thread
where
postuserid=428
and posttime> #2005-10-31#
and posttime< #2005-12-01#