Page 1 of 1
User input date range
Posted: 2022-09-02 20:59
by rpierce
Hello all,
I have a report that queries data in a hardcoded date range. I wonder if there is a way to have a prompt that allows the end user to specify their own date range. In MS Access it's simple task but I can't seem to find a way to do it using MySQL.
As always, thank you for your great brains!!
Ray
Re: User input date range
Posted: 2022-10-07 21:59
by rpierce
Nothing. That's unusual in this forum...
Re: User input date range
Posted: 2022-10-08 13:22
by pbottcher
Hi,
maybe you make your request a bit more specifc. Is the report based on a table you have, or how did you create that report.
You could just a page that asks for your required date range and instead of inserting a record you just redirect to you report page with the date entries passed as variables.
Re: User input date range
Posted: 2022-10-14 15:57
by rpierce
Hi Pascal,
The report is based on several tables in my database. Currently the report is accessed by a button in DV of the parent table. What I'd like to figure out is how to have a prompt that asks the user for a date range they'd like to see in the report. The button is linked to a PHP file in hooks with the following query to obtain a one week look back.
Code: Select all
sql("select {$daily_summary_fields} from {$daily_summary_from} and project={$project_id} and daily_summary.date BETWEEN (NOW() - INTERVAL 7 DAY) AND NOW()", $eo);
I'd like to give the user more control of the length of the look back.
Thank you,
Ray