faqts : Computers : Databases : MySQL : Language and Syntax : Queries : Select

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

29 of 42 people (69%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

How can I select rows from a database with a field between two dates?

Jan 25th, 2000 22:15
Nathan Wallace, Martin Koistinen


MySQL supports the between operator for the DATE field.

    SELECT *
    FROM   Appointments 
    WHERE  Moment BETWEEN StartTime AND EndTime ORDER BY StartTime;