Subject Re: [firebird-support] Average age
Author Hans Hoogstraat
I think the ???? can be the internal FB variable 'current_date'

---------------------------------------------------------------
----- Original Message -----
From: "Andrea Raimondi" <rainaple@...>
To: <firebird-support@yahoogroups.com>
Sent: Sunday, July 11, 2004 9:54 AM
Subject: [firebird-support] Average age


| Hello,
|
| I have a field called DOB( DateOfBirth ) in one of my tables.
| I need to gather average age for males/females artenatively.
|
| My SQL is like this now:
|
| Select avg( ( extract( year from ???? ) - extract(year from DOB) ) /
| count( * ) )from TblPerson where( Sex = 'Female' )
|
| I don't remember how the function to retrieve actual date is called.
| Plus, if you see any other wrong thing with this query, please do
| point me to what's wrong and how to fix it.
|
| TIA,
|
| Andrew
|
|
|
|
| Yahoo! Groups Links
|
|
|
|
|