Hi Trout,
I am suggesting some code please correct me if i am wrong.
the column ageatdeath will always contain values like eg:
51years
62years
45years
suppose the age is "100years" then the below mention query will fail.
"SELECT left(ageatdeath,(len(ageatdeath)-5) as [AGE_VAL], left(ageatdeath,2) AS [AGE_Units] FROM DEATH"
but if you use the below mentioned code then it may not.
SELECT SUBSTRING(ageatdeath,0,CHARINDEX('Y',ageatdeath,0)) AS AGE_VAL,
SUBSTRING(ageatdeath,CHARINDEX('Y',ageatdeath,0),LEN(ageatdeath)) AS AGE_UNIT
Please let me know if it is correct.:-)
Thanks & Regards
Vivek Kumar