drop table if exists sand_scipher_ds_db.public.Age_Dist;
CREATE TEMPORARY TABLE sand_scipher_ds_db.public.Age_Dist as
(select
sum(case when Age_AT_INDEX >= 18 and Age_AT_INDEX <= 34 then 1 else 0 end) as Adults,
sum(case when Age_AT_INDEX >= 35 and Age_AT_INDEX <= 44 then 1 else 0 end) as Early_Middle_Age,
sum(case when Age_AT_INDEX >= 45 and Age_AT_INDEX <= 54 then 1 else 0 end) as Middle_Age,
sum(case when Age_AT_INDEX >= 55 and Age_AT_INDEX <= 64 then 1 else 0 end) as Old,
sum(case when Age_AT_INDEX >= 65 then 1 else 0 end) as Above_65
from sand_scipher_ds_db.public.Rfour);
SQL compilation error: Can not convert parameter '18' of type [NUMBER(2,0)] into expected type [DATE]