I have a database containing shipping details. As part of the error checking system I am trying to write a query that will identify if a ship is incorrectly recorded in two locations on the same day.
There are approx 50 ships and 60 locations all entered in one table in the following format:
Date, Ship, Location.
This is what I have got so far.
This criteria finds 'Ship A' in 'Location 1' if it is entered more than once (which it is allowed to be).
What I am trying to find is 'Ship A' in 'Location 1' on the same date that 'Ship B' is there.
Thanks in advance,
Oscar
There are approx 50 ships and 60 locations all entered in one table in the following format:
Date, Ship, Location.
This is what I have got so far.
Code:
In (SELECT [Location] FROM [Ops_Log_Table] As Tmp GROUP BY [Location],[StartDate] HAVING Count(*)>1 And [StartDate] = [Ops_Log_Table].[StartDate])
This criteria finds 'Ship A' in 'Location 1' if it is entered more than once (which it is allowed to be).
What I am trying to find is 'Ship A' in 'Location 1' on the same date that 'Ship B' is there.
Thanks in advance,
Oscar