How to use a Where clause in SQL Select statements.

In many cases, the Where clause is the most important part of the Select statement. Web developer can find
records that match several conditions using the And keyword, and he/she can find records that match any
one of a series of conditions using the Or keyword. Web developer can also specify greater-than and less-than
comparisons by using the greater-than (>) and less-than (<) operators. The following is an example with a different table and a more sophisticated Where statement:

C# in Depth, 3rd EditionManaged Windows VPS Hosting

SELECT * FROM Orders WHERE ord_date < ‘2011/01/01’ AND ord_date > ‘2009/01/01’

This example uses the international date format to compare date values. Although SQL Server supports many date formats, yyyy/mm/dd is recommended to prevent ambiguity.

If Web developer is using Microsoft Access, he/she would need to use the U.S. date format, mm/dd/yyyy, and replace the apostrophes around the date with the number (#) symbol.