How do I query between two dates using MySQL?

前端 未结 10 2255
滥情空心
滥情空心 2020-11-22 00:58

The following query:

SELECT * FROM `objects` 
WHERE (date_field BETWEEN \'2010-09-29 10:15:55\' AND \'2010-01-30 14:15:55\')

returns nothin

10条回答
  •  广开言路
    2020-11-22 01:40

    Your query should have date as

    select * from table between `lowerdate` and `upperdate`
    

    try

    SELECT * FROM `objects` 
    WHERE  (date_field BETWEEN '2010-01-30 14:15:55' AND '2010-09-29 10:15:55')
    

提交回复
热议问题