I'm trying to calculate clients' age ranges and then sum them.
I originally wrote this in Foxpro, where it works fine. I don't find an IIF() in the IB manual, but very strangely the query errors as > 65 (at the greater than sign) is an unknown token. Is this sort of calculation possible in IB?
Any help appreciated
Bob Hagan
Code:
CREATE VIEw V_FOODROLLUP (ENC_DT, ELDER) AS
SELECT e.enc_dt,
SUM(IIF (((current_date - c.CLI_BDATE)/365) > 65 ,1,0))
FROM encountr e, client c
wHERE c.client_id = e.client_id
GROUP BY e.enc_dt
I originally wrote this in Foxpro, where it works fine. I don't find an IIF() in the IB manual, but very strangely the query errors as > 65 (at the greater than sign) is an unknown token. Is this sort of calculation possible in IB?
Any help appreciated
Bob Hagan