Format for Queries Connected with AND/OR

Discussion created by cfarver on May 19, 2011
Latest reply on Jun 4, 2011 by cfarver

I'm having a bit of trouble trying to find the correct format for connecting two queries together with AND. I feel I've tried so many different combinations, but haven't found a way that works.

What I'm trying to code is a query that searches through a list of houses/apartments by a specified range. At first I was using
query.where = "3_bedrooms <= " + rent;

But found that it would return a lot of properties, as many were initialized to having a rent of 0.

So I tried combining statements along the lines of
query.where = "3_bedrooms > " + 0 + "AND 3_bedrooms <= " + rent;

And many other variations of this line, but nothing seems to work. Been searching online for the correct format, but haven't found anything yet. Can anyone help me out?