Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a date format like
[Create Time Release] [Release Time])
2015-12-17 09:52:24 AM 2015-12-17 09:58:22 AM
I used following script to find the diffrence in HH:MM:SS, But its not working for me.
Interval(
rangesum(
NetWorkDays([Create Time Release] +1,[Release Time]-1) * MakeTime(9) // 8 hours per workday, for all day inbetween the period, excluding bounderies
,if(NetWorkDays([Release Time],[Release Time]),Rangemin(rangemax(frac([Release Time]),maketime(7,30)),maketime(16,30))-Rangemax(rangemin(frac([Release Time]),maketime(7,30)),maketime(7,30)),0) // working hours last day
,if(NetWorkDays([Create Time Release] ,[Create Time Release] ),Rangemin(rangemax(frac([Create Time Release] ),maketime(16,30)),maketime(16,30))-Rangemax(rangemin(frac([Create Time Release] ),maketime(16,30)),maketime(7,30)),0) // working first day
,if(NetWorkDays([Create Time Release] ,[Create Time Release] ) and floor([Create Time Release] )=floor([Release Time]),-MakeTime(7,30)) // correct for first equals last day
)
)
as DurationRelease,
working hours 7:30 to 4:30 and used TimestampFormat= 'YYYY-MM-DD hh:mm:ss[.fff] TT';
Thanks,
Hi,
Interval(YourExpression, format)
please check below thread for detail
Regards
Interval is the solution for your need.
interval(expression [ , format-code ])
The interval function formats the expression as a time interval according to the string given as a format-code. If the format code is omitted, the time format set in the operating system is used. Intervals may be formatted as a time, as days or as a combination of days, hours, minutes, seconds and fractions of seconds.
You are using two arguments, so QV tries to interprete your second argument as format code (which must be a format code string).
If you want to get the difference in days, you need to use a subtraction of your counts (if counting is correct here)
Please don't mark as a Correct Answer before my response on your reply.
Don't worry only the community moderate has that rights others can't mark it , except you
No one can do that except you, AFAIK only creator of the discussion is allowed to mark correct answer
i am not marked as a Correct Answer
interval(timestamp(timestamp#('2015-12-17 09:58:22 AM','YYYY-MM-DD hh:mm:ss TT'))-timestamp(timestamp#('2015-12-17 09:52:24 AM','YYYY-MM-DD hh:mm:ss TT')),'hh:mm:ss')
hth
Sasi