Hello,
I am using the latest version of grafana and trying to apply the selected date range within grafana (from and to range) for the mysql query i have
Pls find the attached image, this works fine but the date time range is hardcoded. Is there a way to pass the from and to date time range to my query command as follows ?
SELECT * from pd_alert where service_cat1='Fraud' AND created_at BETWEEN timestamp '2022-11-06 00:00:00' AND timestamp '2023-01-06 00:00:00'
Note: The format of created_at in my athena table is a timestamp of this format 2022-11-06 00:00:00
Here are some things i tried
SELECT *
FROM your_table
WHERE datetime_column BETWEEN TO_DATE('$__from') AND TO_DATE('$__to');
SELECT *
FROM your_table
WHERE datetime_column BETWEEN FROM_ISO8601_TIMESTAMP('$__from') AND FROM_ISO8601_TIMESTAMP('$__to');
**