I am pulling data from an application that allows duplicate customers (Not sure why but it does). Here is my SQL as it is:
Is there anyway to make it so that when a duplicate street address is shown my query will only pull the first one and ignore the rest?
Code:
SELECT CUSTOMER.FIRSTNAME,
CUSTOMER.LASTORCOMPNAME,
CUSTOMER.ADDRSTR1,
CUSTOMER.ADDRCITY,
CUSTOMER.ADDRSTATE,
Left([ADDRZIPANDEXT],5) AS Zip,
HISTORY.CLOSEDATE,
HISTORY.JOBSTATUS
FROM CUSTOMER INNER JOIN HISTORY ON CUSTOMER.CUSTID = HISTORY.CUSTID
WHERE (((HISTORY.CLOSEDATE)>#7/6/2004#)
AND ((HISTORY.JOBSTATUS)=1 Or (HISTORY.JOBSTATUS)=2 Or (HISTORY.JOBSTATUS)=3))
ORDER BY CUSTOMER.LASTORCOMPNAME, HISTORY.CLOSEDATE DESC;
Is there anyway to make it so that when a duplicate street address is shown my query will only pull the first one and ignore the rest?