Hi guys.
After some inconsistencies using Dates in Variables. My manager asked me if I can print the value of filters in a column.
I always use "Between" in Date filters and sometimes the results do not include the last day.
So, how I can try to print the start date and end date of my variables?
Example:
SELECT
[[{{range_dates}} AS `variable`,]]
SUBSTRING(`contracts`.`contract_item`, 1, 8) AS `contract`,
count(*) AS `num`
FROM `customers_log`
[[WHERE {{range_dates}}]]
GROUP BY `contract`
ORDER BY `num` DESC
OR
SELECT
[[{{range_dates[0]}} AS `start_date`,]]
[[{{range_dates[1]}} AS `end_date`,]]
SUBSTRING(`contracts`.`contract_item`, 1, 8) AS `contract`,
count(*) AS `num`
FROM `customers_log`
[[WHERE {{range_dates}}]]
GROUP BY `contract`
ORDER BY `num` DESC