Filter between dates
Posted: Thu May 02, 2019 11:15 pm
Ok. i throw up the white flag for now. just need a little help if anyone can assist.
I have a query that runs great in mysql and in vici filters i can run them separate. if i add the AND operator, it doesnt return anything in filter preview but i know it will return something, as i can see plenty in mysql directly. i think its a fairly basic query but its kicking my a$$.
my query is as follows in mysql:
select count(*) from vicidial_list where date(entry_date) > date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -30 DAY),' ',CURTIME())) and date(entry_date) < date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -15 DAY),' ',CURTIME()));
basically just want the leads from 15 to 30 days from today.
i have tried this too:
date(entry_date) between date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -30 DAY),' ',CURTIME())) and date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -15 DAY),' ',CURTIME()))
and this:
date(entry_date) > date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -30 DAY),' ',CURTIME())) and date(entry_date) < date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -15 DAY),' ',CURTIME()))
and even this crazy thing:
((date(entry_date) in (select date(entry_date) from vicidial_list where date(entry_date) < date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -15 DAY),' ',CURTIME()))))
and
(date(entry_date) in (select date(entry_date) from vicidial_list where date(entry_date) > date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -30 DAY),' ',CURTIME())))))
I've thrown in more parenthesis in these things than i can express. If anyone has an idea on how to get more than 15 days but less than 30, please throw me a bone.
thanks ahead.
I have a query that runs great in mysql and in vici filters i can run them separate. if i add the AND operator, it doesnt return anything in filter preview but i know it will return something, as i can see plenty in mysql directly. i think its a fairly basic query but its kicking my a$$.
my query is as follows in mysql:
select count(*) from vicidial_list where date(entry_date) > date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -30 DAY),' ',CURTIME())) and date(entry_date) < date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -15 DAY),' ',CURTIME()));
basically just want the leads from 15 to 30 days from today.
i have tried this too:
date(entry_date) between date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -30 DAY),' ',CURTIME())) and date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -15 DAY),' ',CURTIME()))
and this:
date(entry_date) > date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -30 DAY),' ',CURTIME())) and date(entry_date) < date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -15 DAY),' ',CURTIME()))
and even this crazy thing:
((date(entry_date) in (select date(entry_date) from vicidial_list where date(entry_date) < date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -15 DAY),' ',CURTIME()))))
and
(date(entry_date) in (select date(entry_date) from vicidial_list where date(entry_date) > date(CONCAT(DATE_ADD(CURDATE(), INTERVAL -30 DAY),' ',CURTIME())))))
I've thrown in more parenthesis in these things than i can express. If anyone has an idea on how to get more than 15 days but less than 30, please throw me a bone.
thanks ahead.