Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

Can someone show me how to build an AND query on DATE? #117

Closed
ericoe opened this issue Oct 11, 2013 · 2 comments · May be fixed by #123
Closed

Can someone show me how to build an AND query on DATE? #117

ericoe opened this issue Oct 11, 2013 · 2 comments · May be fixed by #123

Comments

@ericoe
Copy link
Contributor

ericoe commented Oct 11, 2013

I'd like an AND query on the date so I can get entries from a specific a time window

$startDate = new stdClass();
$startDate->__type = "Date";
$startDate->iso = "2013-08-01T00:00:00Z";                       

$endDate = new stdClass();
$endDate->__type = "Date";
$endDate->iso = "2013-10-01T00:00:00Z";                     

$query = new parseQuery($libraryTable);
$query->orderByDescending("createdAt");

$query->whereGreaterThanOrEqualTo('createdAt', $startDate);

// if I add this line, I get ALL records because this does an OR on the date.
// because date is >= start OR date is < end
// $query->whereLessThan('createdAt', $endDate);

Thanks!

PS. I highly appreciate this library.

@ericoe
Copy link
Contributor Author

ericoe commented Nov 11, 2013

Thank you! I'll close when I pull.

@ericoe
Copy link
Contributor Author

ericoe commented Nov 12, 2013

Beautiful. Works like a charm! Thank you.

@ericoe ericoe closed this as completed Nov 12, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant