Hi all,
Is it possible to add a column to the below to record how many instances of a matching customer, for the same broker occur on the same date :-
Example output could be
Thanks in advance
Is it possible to add a column to the below to record how many instances of a matching customer, for the same broker occur on the same date :-
Code:
SELECT q.QUOTEID, c.CUSTOMER_NAME, b.BROKERAGE_NAME, q.REQUESTED_SSD
FROM ((TBLQUOTESNEW q LEFT JOIN TBLBROKERAGESNEW b ON q.BROKERAGE_ID = b.ID) LEFT JOIN TBLCUSTOMERSNEW c ON q.CUSTOMER_ID = c.CUSTOMERID) LEFT JOIN TBLSUPPLIESNEW s ON q.SUPPLY_ID = s.SUPPLYID
WHERE (((b.BROKERAGE_NAME) Is Not Null) AND ((q.CONTRACT_TYPE)="Verbal") AND ((s.UTILITY)="Electricity"))
ORDER BY b.BROKERAGE_NAME, q.REQUESTED_SSD;
Example output could be
Code:
QUOTEID CUSTOMER_NAME BROKERAGE_NAME REQUESTED_SSD XCOUNT
1234 CUST1 BROKER1 01/01/2017 2
5678 CUST1 BROKER1 01/01/2017 2
8666 CUST3 BROKER3 01/01/2017 1
Thanks in advance