>Hi...I'm tearing my hair out trying to get an elegant SQL query for finding:
>
>People who were 16 - 21 years of age,
>during our Fiscal Year 2001 (which is 07/1/2000 - 06/30/2001)
>
>I'm using bdate BETWEEN CTOD('07/01/1985') AND CTOD('06/30/1986'),
>and subqueries,
>etc...
>
>But what I want is something like:
>
>SELECT names;
>
>--stuff goes here--
>
>AND age between 16 and 21
>
>TIA
ldFiscalYearStart = {^2000/07/01}
ldFiscalYearEnd = {^2001/06/30}
lnMinAge = 16
lnMaxAge = 21
ldMinBdate = GOMONTH(ldFiscalYearStart,-12*lnMaxAge)
ldMaxBDate = GOMONTH(ldFiscalYearEnd,-12*lnMinAge)
where bdate between ldMinBDate and ldMaxBdate
Cetin