Hi Chad,
the formula to calculate the seconds between 2 timestamps is
((extract(second ; [date2] )) - (extract(second ; [date1] ))) +
((extract(minute ; [date2] )) - (extract(minute ; [date1] )))*60 +
((extract(hour ; [date2] )) - (extract(hour ; [date1] )))*60*60 +
(_days_between( [date2] ; [date1] ))*24*60*60
Cheers
Christian
------------------------------
Christian Seiser
------------------------------
Original Message:
Sent: Fri September 17, 2021 04:42 PM
From: Chad King
Subject: Calculate minutes between 2 dates/times
Hi all,
New here with no formal Cognos training. Trying to figure stuff out on my own and it is a real challenge sometimes.
This question seems so easy but I can find any answers that are helpful.
I am trying to find the time in minutes only between 2 dates/times such as September 1, 2021 1:30 pm and September 1, 2021 3:00 pm. I want the see 90 instead of 1 hour 30 minutes and I can't figure it out.
This is my formula that gives me 1 hour 30 minutes: [Inspection].[Inspection Fact].[Inspection End Datetime]-[Inspection].[Inspection Fact].[Inspection Start Datetime]
I tried changing the format but it never changes.
Any help would be greatly appreciated.
C
------------------------------
Chad King
------------------------------
#CognosAnalyticswithWatson