Is there a way to see how long a file has been sitting in a certain state?

Hello,

I have recently been tasked with querying a bunch of data from different workflows and having Excel put the data into tables.  The queries include number of files in a state, number of files moved in and out of a certain states, and the final piece that i can't figure out, the amount of time (days) a file has sat in a state. Is there a report generator that can give me these numbers that i can dump into Excel?  I know that if i set up a state notification it will give you the number of days (See below) but i was wondering if there is a way to get that metadata.  I'm new to programming and SQL stuff so any help is appreciated.

Thank you!

-Kevin

SolidworksAdministration