EarlStaley
Programmer
I have a table for our membership with a Date field for birthdays. I am trying to get a list of the birthdays ordered by month and date. My first attempt to get the list used this SQL:
"SELECT * FROM FSBC_Member WHERE BirthDate IS NOT NULL ORDER BY BirthDate,LastName,FirstName"
This resulted in a list ordered by oldest to youngest. I just want the birthdays without regard to the year of birth.
My next attempt to get the list used this SQL:
"SELECT * FROM FSBC_Member WHERE BirthDate IS NOT NULL ORDER BY EXTRACT(MONTH FROM BirthDate),EXTRACT(DAY FROM BirthDate), LastName, FirstName"
This did not work either. It appears I cannot use EXTRACT in an ORDER BY clause.
Is there a good way to order the query by month and day from a Date field short of redesigning the table to extract month and date from the Date field?
I am using the Borland Database Engine for Paradox 7 tables.
Thank You...
Earl Staley
"SELECT * FROM FSBC_Member WHERE BirthDate IS NOT NULL ORDER BY BirthDate,LastName,FirstName"
This resulted in a list ordered by oldest to youngest. I just want the birthdays without regard to the year of birth.
My next attempt to get the list used this SQL:
"SELECT * FROM FSBC_Member WHERE BirthDate IS NOT NULL ORDER BY EXTRACT(MONTH FROM BirthDate),EXTRACT(DAY FROM BirthDate), LastName, FirstName"
This did not work either. It appears I cannot use EXTRACT in an ORDER BY clause.
Is there a good way to order the query by month and day from a Date field short of redesigning the table to extract month and date from the Date field?
I am using the Borland Database Engine for Paradox 7 tables.
Thank You...
Earl Staley