|
Using a date constant in a query
EXAMPLE DATABASE: WorldDATA INPUTTable politics in the database World.mdb is used as input.
QUERY date_constantSELECT country, independence, government
FROM politics
WHERE independence IS NOT NULL AND
independence >= #02-Sep-1939# AND
independence <= #03-Sep-1945#;
Query date_constant produces the output below which shows four records of countries that gained independence during World War II, during the period from 2nd September 1939 to 3rd September 1945.
DISCUSSIONThe field independence contains date-type values which are compared with date constants in the query. When using a date constant in a query, the date value needs to be delimited with the # character in order to be correctly interpreted as a date. We strongly recommend using the unambiguous date format dd-mmm-yyyy as shown in the query example.
Last modified September 23, 2008 3:21 am
|