Skip to Content
0
Former Member
Jun 15, 2015 at 04:25 PM

Query issue - selecting the last customer equipment card for a serial item

65 Views

I am trying to select the last (highest numbered or latest) customer equipment card for each of our serialized items. My query picks up all cards, not just the highest numbered one.

SELECT

T0.[insID],

T0.[manufSN],

T0.[custmrName],

T0.[U_Last_Rev_Dt],

T0.[itemCode],

T0.[status]

FROM OINS T0

Where T0.[insID] in

(Select MAX (T1.[insID])

From dbo.OINS T1

Where T0.insID = T1.insID)

-- Group by T0.[manufSN])

ORDER BY T0.[manufSN], T0.[insID]

tbanks@avinger.com