We had a situation where we were tracking run time on a machine, but the owner wanted to know what the EU (Equipment Utilization as a %) for that equipment was. We used two pop-up calendars - one for start date/time, and one for end/date time, used in the query. We already had the total run time for that period, but that had to be subtracted from the total available time for that period. Thus the difference (in minutes) between the start date/time and end date/time had to be determined.
The way to find the difference in minutes between the two dates, which seemed to work best, is to:
- create three dynamic properties: Start_Time_Long, End_Time_Long, Time_Diff. (all are integers)
- on the Start and End time properties, create an expression that type casts your dates toLong.
- this will create long integers out of the dates and times.
- in the Time_Diff property created and expression that says: (End_Time_Long - Start_Time_Long) / 59983.65.
- the rsulting integer in the Time_Diff property will be the amount of time in Minutes between the Start date/time and the End date/time.
- If you need seconds, or hours, etc. you can modify the divisor to get whatever scale is appropriate fo your application.
Hope this helps somebody.