Filter SQL needed!
Posted: Fri Apr 22, 2022 11:32 am
Hello folks!
I need to make a filter like: ( ( (status='NI') and (last_local_call_time < CONCAT(DATE_ADD(CURDATE(), INTERVAL -10 DAY),' ',CURTIME()) ) ) or (status != 'NI') )
but a bit more complex, in which to include more statuses and more criteria, like time and called count.
For example: If a lead, today get a NI status, I want to prevent calling it for 3 days, then try after, and if it is still NI call it after 5 days, then try after, and if is still NI call it after 10 days, and if the last attempt is still NI move it to DNC. Want in the same script to make a kind of same rule even for AB / DROP / A / NA (just as an example)
Can someone help me pls?
I need to make a filter like: ( ( (status='NI') and (last_local_call_time < CONCAT(DATE_ADD(CURDATE(), INTERVAL -10 DAY),' ',CURTIME()) ) ) or (status != 'NI') )
but a bit more complex, in which to include more statuses and more criteria, like time and called count.
For example: If a lead, today get a NI status, I want to prevent calling it for 3 days, then try after, and if it is still NI call it after 5 days, then try after, and if is still NI call it after 10 days, and if the last attempt is still NI move it to DNC. Want in the same script to make a kind of same rule even for AB / DROP / A / NA (just as an example)
Can someone help me pls?