I have a select statement
I don't know what to write in the statement to get the bigger dispatch number to show with customer ID because there are repetitions for dispatch number for a particular customer. I don't need the Max(DispatchNum ber) because it gives me the highest of all the dispatch numbers. How can I get the highest of the dispatch number for a customer.
My Dispatch table looks like:
Code:
SELECT C.CustomerID, D.DispatchNumber FROM tblCustomer C LEFT JOIN tblDispatch D ON C.CustomerID = D.CustomerID WHERE D.DispatchNumber ????(is bigger)
My Dispatch table looks like:
Code:
CustomerID DispatchID --------------------------------- 1 1 --------------------------------- 1 2 --------------------------------- 2 1 --------------------------------- 2 2 --------------------------------- 2 3 --------------------------------- 3 1
Comment