I get a table that is sent to us each day with two text fields in it that represent times (see attached) . As you will see, the SessionStart and the Finished_Time each have values like “8:03:21” or “10:51:07” and are text fields. Neither field is of data type DateTime and neither is stampped “AM or PM”
I need to do a calculation where the Total_Daily_Time = Max(Finished_Time) – SessionStart (SessionStart repeats for each Name). The ActivityID field puts each row in chronological order from earliest to latest. I have a query to get the Max ([ActivityID]) for each Name and therefore associate the Finished_Time to it.
In a Recordset, I read in each row and create each field to look like a DateTime format by adding the mm/dd/yy before each of the times. I am to the point where each field looks something like this “12/05/2005 8:04:31” However, to do the calculation Total_Daily_Time = (DateDiff(“s”,[SessionStart],[Finished_Time])/60)/60, I need to know if these times are “AM” or “PM”.
I can make the assumption that any times that begin with 12,1,2,3,4,5 are “PM”.
Any logic help is greatly appreciated.