I've got a query which looks like this:

(db.tracking.number >= 0) & (db.tracking.number <= 22000)

where number is an integer. And this should select everything with  
numberbetween 0 and 22000 but it doesn't. For example, if I set the query to 
just

(db.tracking.number >= 0)

as expected it grabs anything with a number greater than or equal to 0 and 
I can see all the data. However, if I set it to

(db.tracking.number >= 250)

it grabs everything greater than 250, less than 1000, and will also pick up 
numbers where if a trailing zero was added, it would be within the range 
(ex: 26->260, 27->270, 28->280, 29->290, 30->300, ... ).

I have some strings formatted like this: X##### which I use re.sub to 
remove characters and then use int() to convert the remaining number to a 
int before ever being put into the table. I've checked to make sure 
everything really is an integer before going into the table and it all 
seems to be OK. I'm not sure if this is a python quirk, SQL quirk, or a 
web2py quirk. Any suggestions?

Thanks,
David

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to