Page 1 of 1

Mysql queries filtered by date

PostPosted: Mon Mar 19, 2012 1:21 am
by rudio
Hi all,

New to Vicidial and want to do some custom reporting.

Use to Asterisk but cant seem to get the reports filtered by date as I want to.

I would like to report from the call_log tables only from the 1 March 2012 to 7 March 2012 for instance. Per todays date and from to current date etc.

mysql -D asterisk -e "select * from call_log where date(calldate) > '2012-03-01' order by calldate;
Tried changing date(calldate) to column headers inside tables and filter like that, but its just dumping the whole tables from beginning to end.

Not sure if this belongs on General or support

Any help would be appresiated.

Rudi

PostPosted: Mon Mar 19, 2012 3:41 am
by DomeDan
Hi.

calldate does not exist in call_log or maybe you got a version of vicidial where that column exist?
please tell us your version and other stuff like this:
Vicibox Redux 3.1.9 i686 (svn) | Admin: 2.4-354a 120104-2024 | Agent: 2.4-340c 111227-1940 | astGUIclient 2.4b0.5

in 2.4b0.5 you can just replace calldate to get the data you want:
select * from call_log where date(start_time) > '2012-03-01' order by start_time;

PostPosted: Mon Mar 19, 2012 3:52 am
by rudio
ThanX

select * from call_log where date(start_time) > '2012-03-01' order by start_time;

Will probably work. I added start_time, without the date().


Regards,

Rudi