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

How to select MIN/MAX date field? #15

Closed
nboughton opened this issue Sep 30, 2019 · 1 comment
Closed

How to select MIN/MAX date field? #15

nboughton opened this issue Sep 30, 2019 · 1 comment

Comments

@nboughton
Copy link

nboughton commented Sep 30, 2019

I have a table of records that has a date DATETIME field. I need to select the earliest date and the latest date. In raw SQL this would be

SELECT MIN(date) AS first, MAX(date) AS last FROM table;

However with jet there are only min/max funcs for integers and floats and no apparent way to convert a date field to an integer (effectively render it as unix time). How can I do this with Jet?

@go-jet
Copy link
Owner

go-jet commented Sep 30, 2019

@nboughton Thanks for catching this issue.

The issue is fixed now on develop branch, and it will be released during this week as a hotfix.
Two new methods are added (MIN/MAX) that excepts any expression type.
For example: MIN(table.date) or MAX(table.date).

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

No branches or pull requests

2 participants