Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

between ... and ... #2

Open
timwis opened this issue Jan 13, 2017 · 3 comments
Open

between ... and ... #2

timwis opened this issue Jan 13, 2017 · 3 comments

Comments

@timwis
Copy link
Contributor

timwis commented Jan 13, 2017

ie. $where=date between '2015-01-10T12:00:00' and '2015-01-10T14:00:00'

https://dev.socrata.com/docs/functions/between.html

How is this written in postgres?

@timwis
Copy link
Contributor Author

timwis commented Jan 13, 2017

Also not between, though that's not supported by node-soda2-parser

@andrewbt
Copy link
Contributor

I believe Postgres dates are greater than and less than each other, like numerical values. So I've written the above as

select * from datetable where datecol <= '2015-01-10T12:00:00' and datecol >= '2015-01-10T14:00:00'

I think.

@timwis
Copy link
Contributor Author

timwis commented Feb 24, 2017

It probably supports both. Looks like between and is supported too:

https://www.postgresql.org/docs/9.1/static/functions-comparison.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants