Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get Max Record
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
01399249
Message ID:
01399262
Views:
60
This message has been marked as the solution to the initial question of the thread.
I think in your case max(ActionDate) not equal max(Sequence). Use either one of them, I believe you want max (Sequence), not max(Date).

See changes inside.
>>>select LH.* from LocationHistory LH inner join (select Max(Sequence) as Seq,
>>> PartID, SerialNo from  LocationHistory  group by PartID, SerialNo ) Derived on
>>> LH.Sequence = Derived.Seq and LH.PartID = Derived.PartID and LH.SerialNo = Derived.SerialNo
>
>This is almost there, except I get back rows 2292, 2924, and 2923.
>
>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform