Comparing dates in queries

Sometimes you will not know exactly what value you are looking for, or you would like to see a set of values. You can use comparisons in the WHERE clause to select a set of rows that satisfy the search condition.

Listing employees born before March 3, 1964

The following example shows the use of a date inequality search condition. Type the following:

SELECT Surname, BirthDate
FROM Employees
WHERE BirthDate < 'March 3, 1964'

Surname

BirthDate

Whitney

1958-06-05

Cobb

1960-12-04

Jordan

1951-12-13

Breault

1947-05-13

Espinoza

1939-12-14

Dill

1963-07-19

Francis

1954-09-12

Shishov

1949-04-22

...

...

Sybase IQ knows that the BirthDate column contains a date, and converts 'March 3, 1964' to a date automatically.