P
PaidTheUmpire
Hi,
I've got a table "CALLS" which is in the following format:
ClientID, ClientUnitNumber, Date, CallLength, CallCost
1000000, 94658798, 10/04/06, 40, $2.00
1000000, 94658798, 12/04/06, 230, $9.50
1000000, 94658798, 12/04/06, 120, $6.50
1000005, 98765432, 12/04/06, 120, $6.50
Where each client can have multiple unit numbers.
What I'm trying to get some SQL to show the sum of CallLength and of
CallCost for each day.
SELECT ClientID, ClientUnitNumber, Date, Sum(CallLength), Sum(CallCost)
FROM Calls
GROUP BY ClientID, ClientUnitNumber, Date
HAVING (ClientID="1000000") AND (ClientUnitNumber="94658798");
Which would give the following:
ClientID, ClientUnitNumber, Date, CallLength, CallCost
1000000, 94658798, 10/04/06, 40, $2.00
1000000, 94658798, 12/04/06, 350, $16.00
What i need is a way to show ALL the dates between two preselected
dates (example 9/04/06 and 12/04/06) which give the following:
ClientID, ClientUnitNumber, Date, CallLength, CallCost
1000000, 94658798, 09/04/06, 0, $0.00
1000000, 94658798, 10/04/06, 40, $2.00
1000000, 94658798, 11/04/06, 0, $0.00
1000000, 94658798, 12/04/06, 350, $16.00
Any ideas?
I've got a table "CALLS" which is in the following format:
ClientID, ClientUnitNumber, Date, CallLength, CallCost
1000000, 94658798, 10/04/06, 40, $2.00
1000000, 94658798, 12/04/06, 230, $9.50
1000000, 94658798, 12/04/06, 120, $6.50
1000005, 98765432, 12/04/06, 120, $6.50
Where each client can have multiple unit numbers.
What I'm trying to get some SQL to show the sum of CallLength and of
CallCost for each day.
SELECT ClientID, ClientUnitNumber, Date, Sum(CallLength), Sum(CallCost)
FROM Calls
GROUP BY ClientID, ClientUnitNumber, Date
HAVING (ClientID="1000000") AND (ClientUnitNumber="94658798");
Which would give the following:
ClientID, ClientUnitNumber, Date, CallLength, CallCost
1000000, 94658798, 10/04/06, 40, $2.00
1000000, 94658798, 12/04/06, 350, $16.00
What i need is a way to show ALL the dates between two preselected
dates (example 9/04/06 and 12/04/06) which give the following:
ClientID, ClientUnitNumber, Date, CallLength, CallCost
1000000, 94658798, 09/04/06, 0, $0.00
1000000, 94658798, 10/04/06, 40, $2.00
1000000, 94658798, 11/04/06, 0, $0.00
1000000, 94658798, 12/04/06, 350, $16.00
Any ideas?