Highlighted
Absent Member.
Absent Member.
197 views

How can i calculate timedifference between $Now and a field each time i execute a query?

Hi,

I'm trying to calculate the timedifference between $Now and Create Time field to determine how long a case has been opened. $Now is dynamically generated each time the query is executed. the timedifference function under local variables don't seem to be able to take $Now as a variable in the fields.

Any thoughts?

0 Likes
Reply
3 Replies
Highlighted
Absent Member.
Absent Member.

Re: How can i calculate timedifference between $Now and a field each time i execute a query?

I cannot think of a straight forward answer so I'll settle for an around the way type.

Create a global variable with the evaluateVelocityTemplate function to store the current time.

This function below might work?

#set( $a = $Now )

$a#end

Then in your query do a timediff function, select global variables tab, and then use the Global variable you just created.

.00000000000002 cents so check and verify on your own.

0 Likes
Reply
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: How can i calculate timedifference between $Now and a field each time i execute a query?

Good Afternoon

I have the same problem, I check the velocity template but this didn´t work.

0 Likes
Reply
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How can i calculate timedifference between $Now and a field each time i execute a query?

$Now works under ESM 6.8c and later

0 Likes
Reply
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.