Thanks Niphold. I am aware of that, but forget about it sometimes :( I need bool to be NULL as I have more room for system evolution... Some bool field I set them to not null but some I keep them nullable that can bring me more insight on what going on with the record...
Anyway thanks again... I will check my code for that, cause this mistake is easy to do, since we forgot alot about SQL with web2py (that is good). :) Richard On Thu, Aug 8, 2013 at 8:57 AM, Niphlod <niph...@gmail.com> wrote: > it would give the same result, its the exact same "mental-mistake".... > if you negate the filter you get exactly what you would get negating the > operator > i.e. WHERE NOT column = 'T' matches exactly WHERE COLUMN <> 'T' > > > a column holding a NULL value is "non-existant" for any (and I mean, > really any) where condition you may want to apply, except the specific ones: > - IS NULL > - IS NOT NULL > > On Thursday, August 8, 2013 3:31:17 AM UTC+2, Joe Barnhart wrote: >> >> Not to be flip, but couldn't you just reverse the test and use >> ~(mytable.mybool==False)? That would be false for False and true for True >> and None (NULL) >> >> But I agree it is an interesting find, and I will watch out for this in >> my own code. Thanks for posting! >> >> -- Joe >> >> On Wednesday, August 7, 2013 2:00:42 PM UTC-7, Richard wrote: >>> >>> Hello, >>> >>> Found this not working : >>> >>> db((db.mytable.id == 1) & (db.mytable.mybool != True).select() >>> >>> That translate as : >>> SELECT * FROM mytable WHERE mytable.id = 1 AND mytable.mybool <> 'T' >>> >>> NO RECORD, BUT THERE IS A RECORD >>> >>> If i change the select like this : >>> SELECT * FROM mytable WHERE mytable.id = 1 AND mytable.mybool IS NOT >>> TRUE >>> >>> I get my record. >>> >>> The issue seems to occure only when the "mybool" is NULL other then that >>> (TRUE or FALSE) I got my record... >>> >>> Thanks >>> >>> Richard >>> >>> >>> -- > > --- > 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. > > > -- --- 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.