Highlighted
Absent Member.
Absent Member.
51 views

How to subtract two fields of type Duration

I want to subtract two fields, both of type Duration. Is it possible in HPSD 4.5,sp22? if not,
what can be done as an alternate solution to this?
Please reply soon if you know the solution.
0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

Re: How to subtract two fields of type Duration

Well, you can do it. You must use three date fields.

Suppose that you want to subtract duration1 from duration2

Create a rule that does the following

add duration2 to a custom date field (date1) and store the value to (date2)
add duration1 to date1 and store to date3
set duration = subtract date2 from date3

what you did is this
date2=date1+duration1
date3=date1+duration2

duration=date3-date2=duration2-duration1
menes fhtagn
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: How to subtract two fields of type Duration

thankx for you so quick response
actually, i am trying to get the time diffrence as follows:
1>Actual Time(Type:Duration)= Actual Finish(Type:Date)- Actual Start(Type:Date)

2>Pending Time(Type:Duration)= Pending Start(Type:Date)- Pending End(Type:Date)

3>Resolve Time(Type:Duration)= Actual Time-Pending Time

Now there is no function available to find this difference,
what should i do?
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: How to subtract two fields of type Duration

Another possible solution is to create 2 numeric fields and assign duration 1 and 2, then substract them and store result again in duration field - at least with date fields it was possible to convert them to numeric values and manipulate as you like with them
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.