Page 1 of 1

Sequence Nested_Condiiton

Posted: Tue Jun 21, 2016 8:08 am
by imfarhan
Hi All
I may be doing silly mistake, All I need simply to check the condition if toda'ys date = Monday or 2 then its move to next control and run the Job otherwise it pass value "No" I've used the following condition under expression.

Code: Select all

Name            = Yes
Expression Type = Customer-(Conditional)
Expression      =  If  Oconv(@DATE,'DW')  = 2 Then 'Yes'  Else 'No'
If I run today(Tuesday) the output of my expression should be "3" and it should go to Else condtion and stop the job but it move the next control to run the Job. Could you please advise how can I hand this conditon?

Appreciate your help in advance.
Kind regards,
Farhan

Posted: Tue Jun 21, 2016 9:13 am
by chulett
The "expression" needs to evaluate to true or false and when it evaluates to true the trigger "fires". Without validating the syntax you are using, cut the expression back to something more like this:

Code: Select all

Oconv(@DATE,'DW') = 2
See if that works more better for you. If you still have issues, please spell them out for us, let us know what it is doing along with what it is you want it to do.

Posted: Tue Jun 21, 2016 4:04 pm
by ray.wurlod
Could I suggest, next time you review this expression, that you make it self-documenting? For example

Code: Select all

Oconv(@DATE, "DWA") = "MONDAY"
Using the weekday name rather than a number makes it clearer to the maintenance programmer what you intend(ed).