I have a table in a database set to query our main SQL server and retrieve assets that are currently not used by any employee and set up a SharePoint list to have users update status and when they will be available from a shop, who they will be assigned to etc. I have several queries running on a timer to have this list update throughout the day so the info stays live on the SharePoint list.
I then have another table,
tbl2OpenTractorHistory, that at then end of the day records all open equipment for tracking purposes so we can see trends on units, etc.
I need to add in the consecutive days that a unit spends on open and unoccupied to
tbl1UnseatedTractors. I am stuck on this part, the only way I can think to do this is running a query on
tbl2OpenTractorsHistory that would look for the min and max dates and have an expression column append to
tbl1UnseatedTractors that subtracts the two. But this would give me the historical start and end date in the table, not the most recent consecutive days. Any and all suggestions are very appreciated!