List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:April 27 1999 11:38am
Subject:Re: Order by date
View as plain text  
Peter Hicks wrote:
> 
> Folks,
> 
> I have the following SQL statement:
> 
>    SELECT * FROM members WHERE date_of_birth != '0000-00-
> 00' ORDER BY date_of_birth;
> 
> date_of_birth is a DATE field, and I want to sort the results of the
> query on the month and day - to extract a list of birthdays
> throughout the year, in order, ignoring the year of birth.
> 
> Can anyone help?
> 
> Peter Hicks

Hi Peter

I think you search for:
SELECT
	date_of_birth
	, MONTH( date_of_birth ) AS Month
	, DAYOFMONTH( date_of_birth ) AS Day
FROM
	members
WHERE
	date_of_birth != '0000-00-00'
ORDER BY
	Month
	, Day

Tschau
Christian

Thread
Order by datePeter Hicks27 Apr
  • Re: Order by dateChristian Mack27 Apr
Re: Order by dateFred Lindberg27 Apr