Have a table with one field holding numbers from 0 to about 110. The field has no data type, so it is not integer or text. Now I run the following SQL:
UPDATE table1 SET age_band = (case when age_band <= 10 then ' 0 - 10' when age_band BETWEEN 11 AND 20 then ' 11 - 20' when age_band BETWEEN 21 AND 30 then ' 21 - 30' when age_band BETWEEN 31 AND 40 then ' 31 - 40' when age_band BETWEEN 41 AND 50 then ' 41 - 50' when age_band BETWEEN 51 AND 60 then ' 51 - 60' when age_band BETWEEN 61 AND 70 then ' 61 - 70' when age_band BETWEEN 71 AND 80 then ' 71 - 80' when age_band BETWEEN 81 AND 90 then ' 81 - 90' when age_band BETWEEN 91 AND 100 then ' 91 - 100' when age_band > 100 then ' over 100' else age_band end) Now there are 2 things wrong with the result. Firstly there are no ' 91 - 100' results and there should be as there are numbers in this range. Secondly, the number 100 remains as it is, so it shows as 100 in the output. I thought that as the field has no date affinity, it should be handled as integer numbers and still should hold the text conversions fine. Thanks for any advice as to what is going on here. RBS _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users