I need to find only the last record for each date/time for each unitid in the table.
For each unitid there are many records all submitted over a timespan during the day (every day). Only the last submission on a given date/time for each unitid is required.
If you look at the attached sample, it shows the starting point and the desired result.
The desired result is one row for each unitid for each day - and that row is the last date/time that an entry was submitted.
I think I need to rank these by date in decending order where the rank < 2 but I'm not sure how to create the window over unitid and date.