SQL Query assistance

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

SQL Query assistance

Postby enjay » Mon Feb 11, 2008 11:54 am

Im looking for a query syntax to extract records (based on lead_id) from the vicidial_list table and the vicidial_log table that match a set of specific "statuses" "statuses that ultimately mean will not be dialed again such as disconnected, or business etc". I was trying to use modify_date in the vicidial_log table as an identifier however that date changes when the list is reset.

all I need is the "lastcalled" date, without there being 4-5 of the same phone number records..

hope this makes sense.. any assistance would be great..
enjay
 
Posts: 806
Joined: Mon Jun 19, 2006 12:40 pm
Location: Utah

Postby heinz » Mon Feb 11, 2008 1:29 pm

HI

how about:

Code: Select all
SELECT * from vicidial_list
INNER JOIN vicidial_log
ON vicidial_list.lead_id = vicidial_log.lead_id
WHERE vicidial_list.status=vicidial_log.status
AND vicidial_list.user = vicidial_log.user
AND vicidial_list.status ='$status'
AND vicidial_log.call_date BETWEEN '$datestart' AND '$dateend';


Cheers,
heinz
heinz
 
Posts: 106
Joined: Mon Oct 08, 2007 1:30 am
Location: South Africa


Return to Support

Who is online

Users browsing this forum: No registered users and 135 guests