I think it might be that Case ldTot > 2 and ldTot < 5 evaluates out to a boolean, but the select case is an integer. You need to use the to keyword to evaluate as an integer.
Try something like this:
select case ldTot
case 0
demoTenure.DemographicValue = "Less than 1 Year"
case 1, 2
demoTenure.DemographicValue = "1 - 2 Years"
case 3, 4
demoTenure.DemographicValue = "3 - 4 Years"
case 5
demoTenure.DemographicValue = "5 Years"
case 6 to 10
demoTenure.DemographicValue = "6 - 10 Years"
case 11 to 19
demoTenure.DemographicValue = "11 - 19 Years"
case else
demoTenure.DemographicValue = "20 Years or more"
end
I think that you are seeing the issue because the Case statement arguments are being evaluated as Booleans.
Case ldTot >= 1 and ldTot < 3
evaluates as if condition 1 is true and if condition 2 is true then... but since you’re specifying integer as the select basis, you get the error.