Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Rule Error

Highlighted
Ryan Grobler
Regular Collector

Rule Error

Hi All

I am trying to write a rule regarding dates; I have 2 dates, if Data 1 > Date 2 then Field 1 = Yes, and when Date 1 < Date 2 then field 1 = No.

The rule I have written is:

select case

When ('[REQD.P.HC_ACT_DELIVERY_END_DATE]' > '[REQD.P.HC_PLAN_DELIVERY_END_DATE]') Then 'No'
When ('[REQD.P.HC_ACT_DELIVERY_END_DATE]' < '[REQD.P.HC_PLAN_DELIVERY_END_DATE]') Then 'Yes'

Case

When ('[REQD.P.HC_ACT_DELIVERY_END_DATE]' > '[REQD.P.HC_PLAN_DELIVERY_END_DATE]') Then 'No'
When ('[REQD.P.HC_ACT_DELIVERY_END_DATE]' < '[REQD.P.HC_PLAN_DELIVERY_END_DATE]') Then 'Yes'

From dual

Both the date fields are from the standard 'date' validation'

Any reason why this doesn't work?
3 REPLIES
Erik Cole
Honored Contributor

Re: Rule Error

Hi Ryan,

Looks like you need a couple of ENDs and a comma:

select case

When ('[REQD.P.HC_ACT_DELIVERY_END_DATE]' > '[REQD.P.HC_PLAN_DELIVERY_END_DATE]') Then 'No'
When ('[REQD.P.HC_ACT_DELIVERY_END_DATE]' < '[REQD.P.HC_PLAN_DELIVERY_END_DATE]') Then 'Yes'
END,

Case

When ('[REQD.P.HC_ACT_DELIVERY_END_DATE]' > '[REQD.P.HC_PLAN_DELIVERY_END_DATE]') Then 'No'
When ('[REQD.P.HC_ACT_DELIVERY_END_DATE]' < '[REQD.P.HC_PLAN_DELIVERY_END_DATE]') Then 'Yes'
END
From dual
Sascha Mohr
Esteemed Contributor

Re: Rule Error

Hello Ryan,
the columns in the request details table are of type text, you need to convert the text back to dates in order to use them. The only dates in the table that are of type date/time are the standard columns created, last updated etc.
Ryan Grobler
Regular Collector

Re: Rule Error

Hi Erik

that works! Awesome! thank you so much!!!
//Add this to "OnDomLoad" event