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

Statistics not showing #141

Open
helmutkaufmann opened this issue Oct 8, 2020 · 2 comments
Open

Statistics not showing #141

helmutkaufmann opened this issue Oct 8, 2020 · 2 comments

Comments

@helmutkaufmann
Copy link

helmutkaufmann commented Oct 8, 2020

/backend/indikator/news/statistics cannot be found, the error is is

SQLSTATE[HY000]: General error: 1 no such function: YEAR (SQL: select count(id) as c, YEAR(queued_at) as y, MONTH(queued_at) as m from "indikator_news_newsletter_logs" group by YEAR(queued_at), MONTH(queued_at) order by "y" asc, "m" asc)

Is it possible that I get this as I use an SQLITE database as opposed to the standard MYSQL?

@gergo85
Copy link
Owner

gergo85 commented Oct 8, 2020

It is possible.

@TimFoerster
Copy link
Contributor

SQLite does not have a YEAR nor MONTH function.
Instead use strftime('%Y', queued_at), unfortunately this is not compatible with other SQL databases.

Might it be possible to rewrite this query with eloquent?

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

3 participants