Hi Clemens, Thanks for the pointer although I'm doing this the other way around. I'm casting an INTEGER to a TEXT value.
I think Michael is probably on the right track here, this is to do with operator precedence. Cheers, Dave Ward Analytics Ltd - information in motion Tel: +44 (0) 118 9740191 Fax: +44 (0) 118 9740192 www: http://www.ward-analytics.com Registered office address: The Oriel, Sydenham Road, Guildford, Surrey, United Kingdom, GU1 3SR Registered company number: 3917021 Registered in England and Wales. -----Original Message----- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Clemens Ladisch Sent: 31 May 2013 17:43 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Concatenating literals with column values Dave Wellman wrote: > Why do I need the "()" around my calculation? <http://www.sqlite.org/lang_expr.html#castexpr> says: | When casting a TEXT value to INTEGER, the longest possible prefix of | the value that can be interpreted as an integer number is extracted | from the TEXT value and the remainder ignored. Any leading spaces in | the TEXT value when converting from TEXT to INTEGER are ignored. If | there is no prefix that can be interpreted as an integer number, the | result of the conversion is 0. So the result of 'forty-two'+0 is 0. Regards, Clemens _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users