I tried your suggestion, but it didn't seem to help. In addition, I've slightly changed the initial report so now both the AJAX and non-AJAX tabs use the same report, they were already nearly identical anyway. The new code for the AJAX report pulls data from all possible date ranges, which is what the original AJAX report did anyway and is as follows:
SELECT 'dbr.tab', 'AJAX Report', 'https://www.my_real_url.com/mydbr/report.php?r=20&u1=2012-12-31&u2=2112-12-31+17%3A33%3A12&m=4&h=2cec895357af43c5d3cee7d3495ed5f4246d091a&embedi=1';
The same problem occurs when this report is run and I thought it'd be easier to troubleshoot if you could see the code for the actual report that is running.
The code for this report is as follows:
DROP PROCEDURE IF EXISTS sp_DBR_date_range_test
$$
CREATE PROCEDURE sp_DBR_date_range_test
(start_date DATE ,end_date DATE)
BEGIN
SELECT 'dbr.parameters.show';
SELECT 'dbr.title', concat('Report For Selected Date Range: ', start_date, ' to ', end_date);
SELECT 'dbr.keepwithnext';
SELECT 'dbr.chart' , 'Bar', 'Graph 1 Title';
SELECT location
,count(location
)
FROM database
.table
WHERE flag
='yes'
AND location
IS NOT NULL
AND location
!= ''
AND DATE(internal_start
) BETWEEN start_date AND end_date
GROUP BY location
ORDER BY location
;
SELECT 'dbr.keepwithnext';
SELECT 'dbr.chart', 'Bar', 'Graph 2 Title', '480';
SELECT 'Value 1' AS 'Type', SUM(column_14_name
LIKE 'value1') AS 'Total'
FROM database
.table
WHERE flag
= 'yes'
AND DATE(internal_start
) BETWEEN start_date AND end_date
UNION
SELECT 'Value 2' AS 'Type', SUM(column_14_name
LIKE 'value2') AS 'Total'
FROM database
.table
WHERE flag
= 'yes'
AND DATE(internal_start
) BETWEEN start_date AND end_date
UNION
SELECT 'Value 3' AS 'Type', SUM(column_14_name
LIKE '') AS 'Total'
FROM database
.table
WHERE flag
= 'yes'
AND DATE(internal_start
) BETWEEN start_date AND end_date;
SELECT 'dbr.chart' , 'Column', 'Graph 3 Title', '180';
SELECT 'Male' AS 'Gender', SUM(gender
LIKE 'male') AS 'Total'
FROM database
.table
WHERE flag
= 'yes'
AND DATE(internal_start
) BETWEEN start_date AND end_date
UNION
SELECT 'Female' AS 'Gender', SUM(gender
LIKE 'female') AS 'Total'
FROM database
.table
WHERE flag
= 'yes'
AND DATE(internal_start
) BETWEEN start_date AND end_date;
SELECT column_1_name
as 'Column 1',
column_2_name
as 'Column 2',
column_3_name
as 'Column 3',
gender
as 'Gender',
column_4_name
as 'Column 4',
column_5_name
as 'Column 5',
column_6_name
as 'Column 6',
column_7_name
as 'Column 7',
column_8_name
as 'Column 8',
column_9_name
as 'Column 9',
column_10_name
as 'Column 10',
column_11_name
as 'Column 11',
column_12_name
as 'Column 12',
column_13_name
as 'Column 13',
column_14_name
as 'Column 14',
column_15_name
as 'Column 15',
internal_start
as 'Start Time',
internal_end
as 'End Time',
column_16_name
as 'Column 16',
column_17_name
as 'Column 17',
column_18_name
as 'Column 18'
FROM database
.table
WHERE flag
= 'yes'
AND DATE(internal_start
) BETWEEN start_date AND end_date;
END
$$