Good morning,
I am trying to pull records from a table that has new records created every few seconds, and generate a summary of those records by 15 minute intervals. Of note, I’m pulling off a backup MySql database, and am using Scriptcase version 7.01.0020. If I run the following query in MySql (actually I use the Webmin MySql interface), it works fine.
SELECT Date, sec_to_time(time_to_sec(Time)- time_to_sec(Time)%(15*60)) as TimePrd, sum(PostTime) as Post_Time, sum(Wait)/sum(Inbound_Act) as Avg_Wait from Calculated_Stats
WHERE Date > current_date - 2
group by TimePrd
But when I copy/paste it into the creation of a grid, and run the grid, I get the error below:
Error
Error while accessing the database:
Unknown column ‘TimePrd’ in ‘group statement’
select count(*) from Calculated_CallStats where Date > current_date - 2 group by TimePrd
Can anyone tell me what I’m doing wrong? Ultimately I want to use the resulting data to create daily graphs of Post_Time and Avg_Wait for each 15 min TimePrd.
Thanks in advance for any help or suggestions!
Mark.