Try this (where age is the formula you're already using). I'd recommend
making a view that has the age as one of the columns.

SELECT

CASE WHEN age <= 16 THEN 1
       WHEN age BETWEEN 17 AND 25 THEN 2
       WHEN age BETWEEN 26 AND 40 THEN 3
       ELSE 4
END  AS [group]



________________________________________
From: Spectrum WebDesign [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 26 May 2004 8:22 a.m.
To: CF-Talk
Subject: [OT] SQL help

Hi

I have an table were our client save your dob(mm/dd/yyyy) in My$QL DB. By
now I need to aggrupate that table queries like this:
Group 1: <= 16 years

Group 2: >=17 E <= 25

Group 3: >=26 E <= 40

Group 4: >=41 years

My$SQL give the ages but how to aggrupate in that groups?

Thanx for your time.

--
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm
________________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to