I have a table with Invoice Number, State, State dt, State tmstp
State has 5 values like Delivered, spooled, prepared etc.
I need to get the the state of a invoice number with most recent date and time tmstp.
For ex: if I have 4 states for a invoice with different dates and time, I need to...