Hi

You could try this.

Create a composite string field of all three values padded with 0's
for the numerics so that they will sort alphabetically

for instance a new field (composite_field)   date + foo + bar

where date   20100221  (YYYYMMDD)
foo is 000000002
bar is 000000041

So your field value will be

20100221000000002000000041

Now you can use multiple inequality filters on the same field

For instance
assuming the date we want is >  01 jan 2010
and we want foo > 0
and bar < 42

Query q =  new Query("MyKind")
        .addFilter("composite_field", GREATER_THAN,
'20100101000000000')     Which sorts the date > 01 Jan 2010 and foo >
1
        .addFilter("composite_field", LESS_THAN,
'20100101000000000000000042');   which gets you the less than 42


It might work for you.

Cheers

T





On Mar 13, 7:53 pm, Patrick Twohig <patr...@namazustudios.com> wrote:
> So, the business requirements of my application need a query which needs to
> search for a property (let's call it "foo") and a date property such that it
> will filter out all objects older than a certain date.  I guess in GAE/J
> this would be something like....
>
> Query q =  new Query("MyKind")
>         .addFilter("foo", GREATER_THAN, 0)
>         .addFilter("bar", LESS_THAN, 42)
>         .addFilter("date", GREATER_THAN, someDate);
>
> But, I'm guessing that wouldn't work because it's got inequality filters on
> multiple properties.  Would there be a way to get a similar result without
> loading a huge amount of entities into memory and filtering them out
> manually?
>
> --
> Patrick H. Twohig.
>
> Namazu Studios
> P.O. Box 34161
> San Diego, CA 92163-4161

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to