I'm trying to find a way, either in SQL or SSRS, to compare rows that have similarities but have one field that is different.
I have a report that is showing late shipments. If the order had 2 items, and both shipped late, but on different days, I don't want both items to show up, I only want the last one to ship to show up.
Unfortunately there isn't a trigger or field that lets me know which was the last one shipped, but I found the shipping table master that has all the shipments and dates.
So the query I think I can use would be something like
TABLE.jobNumber + TABLE.shipDate > TABLE.jobNumber + TABLE.shipDate
so if the job number is the same, then only return the row that has the higher shipDate
Hopefully that makes sense.