posted 20 years ago
I use scalar functions to get date information from date fields in a query.
For example I have a table called EMPLOYEE and it has a BIRTHDATE field. If I wanted to split out the month, day, year here's how I'd do that.
SELECT firstname, lastname, MONTH(birthdate), DAY(birthdate), YEAR(birthdate)
FROM employee
WHERE department = "01"
You'd get something like this:
Bob, Smith, 8, 25, 1971
Sam, Thompson, 5, 11, 1966