# Calculating the # of minutes between 2 datetime fields

I am trying to find the number of minutes from the time a patient enters a room until they leave. I found this formula through a google search that lead me to another forum here:

https://bobj-board.org/t/117814

``=DaysBetween([Actual Start Date and Time];[Actual Stop Date and Time]) * 86400 + ( ToNumber(FormatDate([Actual Stop Date and Time] ;"HH")) * 3600 + ToNumber(Left(FormatDate([Actual Stop Date and Time] ;"mm:ss") ;2)) * 60 + ToNumber(FormatDate([Actual Stop Date and Time];"ss"))) - (ToNumber(FormatDate([Actual Start Date and Time];"HH")) * 3600 + ToNumber(Left(FormatDate([Actual Start Date and Time] ;"mm:ss") ;2)) * 60 + ToNumber(FormatDate([Actual Start Date and Time] ;"ss")))``

I have been trying to make similar adjustments to the other code that was in that thread, but am running into the wall.

``````=FormatNumber(Floor(<number of seconds>/86400) ,"0") &amp; " day(s) " &amp;
FormatNumber(Floor(Mod(<number of seconds> ,86400)/3600) ,"00") &amp; ":" &amp;
FormatNumber(Floor(Mod(Mod(<number of seconds> ,86400) ,3600)/60) ,"00") &amp; ":" &amp;
FormatNumber(Mod(Mod(Mod(<number of seconds> ,86400) ,3600) ,60) ,"00")``````

I can write Crystal coding with my eyes closed, but I have had no real training with this system and have not been able to find anything so far that I can use to learn the coding language…