I am looking to take two timestamp() fields and calculate the minutes difference between both fields.
The following expression returns 12:01:00 AM
{! if document.CM_START_TIME<>""
and document.CM_END_TIME<>""
then document.TOTAL_TIME= val(document.CM_END_TIME) - val(document.CM_START_TIME) else "" endif}
Looking for advice
What you might have to do is take the hour part of the time and multiply that by 60 and add that to the minutes for the first time value and then do that for the second time value and then subtract the total minutes of the minutes value # 2 from the total minutes of minutes value # 1.
The link above is a sample form that contains code that might provide you some insight. Feel free to modify as needed.
Would you be able to provide this function?