✔ 最佳答案
select * from table1 where thedate between '200/1/1' and '2007/1/31'
or
select * from table1 where thedate >= '200/1/1' and thedate <= '2007/1/31'
For Access database, use # instead of single quote for date.
Beware of the trick, your date field may include the time part, in that case, the date range you select should be
thedate >= '2007/1/1/' and thedate < '2007/2/1'
because without specifying the time, 2007/1/31 is the same as 2007/1/31 12:00AM
The date that is 2007/1/31/ 13:00 will be excluded.
2007-07-17 06:01:27 補充:
Why are you not sleeping at this time of the day?
2007-07-17 06:06:04 補充:
What is your database platform?Month(thedate) = 1 Access, SQL Server, mysql
2007-07-17 23:08:28 補充:
[ 我剩係要一月既記錄要點做呢?但我剩係想指定月份,即係2005、2006、2007既結果都有]select * from table1 where MONTH(thedate) = 1
2007-07-17 23:10:11 補充:
universal 的日期格式為 m/d/yyyy, e.g. 1/31/2007