I have a duration column in SQL that is (datediff(minute,[InTime],[OutTime])). Then I sum the status during that duration to get the % time spent in each status. My question is the most current status does not have an OutTime yet and therefore no duration, thus it is being excluded from the %.
What I would like to do is use Getdate() as the OutTime so that when a query is ran it is always recalculated to the current time. Key is that OutTime needs to remain null.
I was thinking (if(OutTime is null, datediff(minute,[InTime],GetDate()), datediff(minute,[InTime],[OutTime])))
I get an error validating field when I do that. I guess I could throw it in a view and query that instead.