Hi,
I need help with my WHERE clause syntax. I’m looking to return rows that have a certain date that’s older than a month.
Example:
SELECT…
WHERE tbl_date < CURRENT_DATE – 30 DAYS
I’ve tried no less than 8,000 variations of this, but always got an SQL error along with a very unhelpful message. Any ideas?
Thanks
Help with WHERE clause syntax in SQL
Help with WHERE clause syntax in SQL
OpenOffice 4 on Windows 10
Re: Help with WHERE clause syntax in SQL
Try
Code: Select all
WHERE DATEDIFF('dd', tbl_date, CURRENT_DATE) > 30
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: Help with WHERE clause syntax in SQL
If the status bar of your database document window looks like this ...
... then your database is HSQL 1.8 which is documented here: http://www.hsqldb.org/doc/1.8/guide/ch09.html
... then your database is HSQL 1.8 which is documented here: http://www.hsqldb.org/doc/1.8/guide/ch09.html
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice