Hey everyone!
With the Labour Day holidays coming up, we’d like to let you know about our upcoming working hours:
Thursday, May 1st: Our team will be off during Labour Day.
Friday, May 2nd: We'll also be off for an extended holiday break.
We’ll be back on Monday, May 5th, ready to respond to all messages received during this time.
In the meantime, if you need help, feel free to:
-
Use the support widget on the bottom right of our websites (Amelia and wpDataTables) — our AI-powered assistant is available 24/7 and can help with many common questions.
-
Visit our documentation, articles, or YouTube channels for quick answers and step-by-step guides.
https://www.youtube.com/@AmeliaWordPressBookingPlugin/videos
https://www.youtube.com/@wpDataTables/videos
Thank you for being so understanding, and we hope you enjoy the long weekend!
Hello,
I have a query that i am trying to run (See Below), however the query comes back with an error -
Error
unknown [expr_type] = reserved in "WHERE" [4]
The query i am executing is -
SELECT DATE(`created`) AS created_date, `Extension`, SUM(CASE WHEN `Call_type` = "Incoming" AND `Extension` != 2504 THEN 1 ELSE 0 END) AS CallsAnswered, SUM(CASE WHEN `Call_type` = "Incoming" AND `Extension` = 2504 AND `Dialed_digits` LIKE 'R%' THEN 1 ELSE 0 END) AS CallsRecieved FROM mp_wp_call_report_pstn WHERE `created` BETWEEN NOW() - INTERVAL 31 DAY AND NOW() GROUP BY DATE(`created`) ORDER BY `created` ASC LIMIT 0, 32
Removing the "INTERVAL 31 DAY" resolves the issue and allows the query to proceed. However when processing this manually on MYSQL, the query works without issue and provides the relevant data.
Is there a way you have to specify an interval or is this not supported in wpDataTables ?
Regards,
Matt
Hi Matt,
Thank you for your purchase.
Our recommendation when creating mysql tables is not to use functions like SUM, GROUP BY, ORDER BY etc.
If you have some complicated query my suggestion is to make a VIEW in phpmyadmin or any other database management system and see if that query returns the desired result.
If the result is good , use that query as an input when creating the tables with Add from data source option.
Best regards.
Kind Regards,
Miloš Jovanović
milos.jovanovic@tmsproducts.io
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables