Attached you will find a rate table used for benefits. I need to retrieve the BN_EMPL_RATE value for an individual. I would like the approach to find the age on this table
. There is a field called : BN_RATE_KEY03. This corresponds to the Age.
So - for a 52 year old, this individual would be between BN_RATE_KEY03 = 50 (0.54320) -and BN_RATE_KEY03 = 55(0.73120) WITH BN_RATE_KEY01 (N) -smoking and BN_RATE_KEY01 (F)-female ; The BN_EMPL_RATE VALUE = (0.54320);
My Attempt: This is how I am trying to get the AGE
AND floor( ( CAST(CONVERT(VARCHAR(8) ,getdate() ,112) AS INT)- CAST(CONVERT(VARCHAR(8) ,EMPDEP2.BIRTHDATE,112) AS INT) ) / 10000 ) BETWEEN (SUBSTRING(BRD.BN_RATE_KEY
03,19,2)) AND ( 4 + SUBSTRING(BRD.BN_RATE_KEY0
Fails because I am not getting the 30 year olds.
What technique would you use to get the age. I am attaching the rate table to show you the data.
Any help would be greatly appreciated,