Hi,

db.GqlQuery('SELECT * FROM myTable where start_date>=:cdate and
end_date<=:cdate',cdate=current_date)

You are trying to use in-equality filters on two properties in a
single query.. Does this not raise an Exception?

There was a post on how to do this more efficiently in the groups
somewhere, but in your case I think you need to query based on one
date from the datastore and do some logic in the view.

> SELECT * FROM Image where added > DATETIME(2009,1,1,0,0,0) and added <
> DATETIME(2009,2,1,0,0,0)

In this example both are applied to the same property.

Thanks,
Arun Shanker Prasad.

On Feb 3, 4:17 pm, niklasr <nikla...@gmail.com> wrote:
> gql as below works.
> SELECT * FROM Image where added > DATETIME(2009,1,1,0,0,0) and added <
> DATETIME(2009,2,1,0,0,0)
> we must use the integer form (the manual lists b0rked 
> forms)http://code.google.com/p/googleappengine/issues/detail?id=878
> cheers
> niklas
>
> On Feb 3, 12:02 pm, arnie <parvez...@rediffmail.com> wrote:
>
> > For a datastore table with two db.DateTimeProperty columns start_date
> > and end_date, i need to use a date range in query but below given
> > query is not working
> > current_date=datetime.datetime.strptime(self.request.get
> > ('current_date'), '%Y-%m-%dT%H:%M:%S')
>
> > db.GqlQuery('SELECT * FROM myTable where start_date>=:cdate and
> > end_date<=:cdate',cdate=current_date)
> > in the parameters I am passing current_date=2009-01-10T00:00:00
> > Should we not compare dates this way?
> > But this is not working
--~--~---------~--~----~------------~-------~--~----~
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-appengine@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