Select all fields with length > 0?

12 views
Skip to first unread message

LoveWeb2py

unread,
May 29, 2015, 6:19:44 PM5/29/15
to web...@googlegroups.com
db((db.table.field1.id>0)&(db.table.field2.length>0)).select()

This still returns the whole field. I'm thinking the length takes the length of the entire field. How can I bring back all records that aren't empty for a field

For example

db.table.field2

row1: has information
row2: <empty>
row3: has information

in my query I only want to return row 1 & 3. I'm sure there is an easy way to do this?

LoveWeb2py

unread,
May 29, 2015, 6:24:23 PM5/29/15
to web...@googlegroups.com
Sigh.... should have thought a little more before posting. Sorry about this

This works:
db((db.table.field1.id>0)&(db.table.field2!='')).select()
Reply all
Reply to author
Forward
0 new messages