2013-06-12 76 views

回答

0

試試這個,你可以使用between功能也

select * from table where date_column between '2013-01-10 00:00:00' and '2013-06-12 00:00:00' 
+0

不錯,謝謝你的回答。 –

0

這個?

SELECT * FROM table WHERE date1 => '2013-03-05 0:00' AND date2 <= '2013-03-20 0:00' 
+0

不工作錯誤sql語法。 –

0

根據你想打破它(例如,如果你想從2013年3月5日00:00:00至2013年3月19日23:59:59去了),你應該能夠只是在你的日期字段使用> =/<:

SELECT * 
    FROM mytable 
WHERE date_field >= '2013-03-05' 
    AND date_field < '2013-03-20' 
+0

(如果你想包括2013-03-20 00:00:00然後在第二個條款中使用「<=」) – caponica

+0

是啊,謝謝... –