dim bdate,edate
bdate = "2007-8-7 8:00:00" ''实际操作中应该是从表单接收
edate = "2007-8-7 20:00:00"
rs.open "select id from OrderList where OrderTime Between '"& bdate &"' and '"& edate &"'",conn,1,1
查询今日 8:00:00 - 20:00:00 所有数据
rs.open "select id from OrderList where OrderTime Between '"&date()&" 8:00:00' and '"&date()+1&" 20:00:00'",conn,1,1
查询昨日 20:00:00 - 8:00:00 所有数据
rs.open "select id from OrderList where OrderTime Between '"&date()-1&" 20:00:00' and '"&date()&" 8:00:00'",conn,1,1
dim bdate,edate
bdate = dateAdd("d",-1,now())
edate = now()
rs.open "select id from OrderList where OrderTime Between '"& bdate &"' and '"& edate &"'",conn,1,1
dim bdate,edate
bdate = dateAdd("d",-1,date()) & " 8:00:00"
edate = date() & " 20:00:00"
rs.open "select id from OrderList where OrderTime Between '"& bdate &"' and '"& edate &"'",conn,1,1