Highlighted
Absent Member.. Absent Member..
Absent Member..
327 views

Trying to calculate days between 2 dates with an advanced rule (error)

Jump to solution

Hello

 

I am trying to calculate the days between 2 dates into an advanced rule in PPM but it fails always.

 

I do it with a normal SQL statement and it works propertly.

 

the statement for the SQL:    (tora.jpg)

SELECT TO_DATE(PARAMETER19) - TO_DATE(PARAMETER18),  TO_DATE(PARAMETER19) - TO_DATE(PARAMETER18) FROM PPMUSER.KCRT_REQ_HEADER_DETAILS WHERE REQUEST_ID = 31236;

 

The Rule is on -> Rule.jpg

 The error is on -> error.jpg

 The sql statement succesfull -> Tora.jpg

 The content of parameters -> Parameters.jpg

 

Thank you very much

 

 

 

 

 

 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.. Absent Member..
Absent Member..

Hello

 

Thank you very much. 

 

the statement that works in this case is:

"SELECT
TO_DATE(PARAMETER19, 'YYYY-MM-DD HH24:MI:SS') - TO_DATE(PARAMETER18, 'YYYY-MM-DD HH24:MI:SS'), TO_DATE(PARAMETER19, 'YYYY-MM-DD HH24:MI:SS') - TO_DATE(PARAMETER18, 'YYYY-MM-DD HH24:MI:SS') FROM PPMUSER.KCRT_REQ_HEADER_DETAILS
WHERE REQUEST_ID = 31236"

View solution in original post

0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

Hi Marcus,

try remove the semicolon mark from the end of the sql statement in the rule.

 

Regards

 

Radim

Highlighted
Absent Member.. Absent Member..
Absent Member..

Here is an example of what we are doing (slightly different, since we are calculating days, hours, minutes)

Highlighted
Absent Member.. Absent Member..
Absent Member..

Hello

 

Thank you very much. 

 

the statement that works in this case is:

"SELECT
TO_DATE(PARAMETER19, 'YYYY-MM-DD HH24:MI:SS') - TO_DATE(PARAMETER18, 'YYYY-MM-DD HH24:MI:SS'), TO_DATE(PARAMETER19, 'YYYY-MM-DD HH24:MI:SS') - TO_DATE(PARAMETER18, 'YYYY-MM-DD HH24:MI:SS') FROM PPMUSER.KCRT_REQ_HEADER_DETAILS
WHERE REQUEST_ID = 31236"

View solution in original post

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.