Here's a query that works 

sqlStatement = [NSString stringWithFormat:@"SELECT * FROM stations WHERE
state like '%@ %'",theState]; <--- this yields a result: 0

sqlStatement = [NSString stringWithFormat:@"SELECT state, power || ' kW'
power FROM (SELECT state, Cast(Rtrim(power, 'kW') AS 'numeric') power FROM
stations ORDER BY power)",theState]; 

I get a result: 1 from that last one... "theState" in this code is a
variable for that specific state I need.
-- 
View this message in context: 
http://old.nabble.com/trim-alpha-numeric-string-so-it%27s-numeric-cast-then-order-tp33711898p33712000.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to