Forum Moderators: open

Message Too Old, No Replies

listing by date of births

Finding dob in table

         

shaundunne

1:49 pm on Jan 21, 2008 (gmt 0)

10+ Year Member



I have a table with detail such as firstname,surname and dob.

I want to count everybody's date of births and group the results by date of birth so...

ages 60-69 with dob between january and march
ages 50-59 with dob between january and march
ages 40-49 with dob between january and march

and so on and so on.

Do i have to just do a selection with every dob seperatly or can i combine the results into a quick sql query?

Cheers

coopster

6:46 pm on Jan 21, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Calculate the age and use a GROUP BY on the age categories. Your WHERE clause could filter out those birthdates that fall in the months required.