|
Extracting weekday name and month name from a date
EXAMPLE DATABASE: WorldDATA INPUTTable politics in the database World.mdb is used as input.
QUERY date_namesSELECT country, independence,
WEEKDAYNAME(WEEKDAY(independence)) AS weekday,
MONTHNAME(MONTH(independence)) AS month,
government
FROM politics
WHERE independence IS NOT NULL;
Query date_names produces the output below which shows two additional columns containing the name of the weekday and the name of the month.
DISCUSSIONThe queries above show how the names of date elements (weekday name, month name) can be extracted from a date-type field. The weekday and the month are first extracted as numbers, which are in turn converted to names with the special functions WeekdayName( ) and MonthName( ).
Last modified September 23, 2008 3:19 am
|