Friday, 23 August 2013

SQL Join Statement based on date range

SQL Join Statement based on date range

New SQL dev here. I'm writing a call log application for our Asterisk
server. In one table (CDRLogs), I have the call logs from the phone system
(src, dst, calldate, duration). In another table I have (Employees) I have
empName, empExt, extStartDate extEndDate). I want to join the two together
on src and empExt based on who was using a particular ext on the date of
the call. One user per extension in a given time frame.
For example, we have had 3 different users sitting at x100 during the
month of July. In the Employees table, I have recorded the dates each of
these people started and ended their use of that ext. How do I get the
join to reflect that?
Thanks in advance

No comments:

Post a Comment