cancel
Showing results for 
Search instead for 
Did you mean: 

Compare DateField

Former Member
0 Kudos

Hi All,

We have a requirement to compare the date field with the system date.

Requirement:

1. Check with the System Date is equal to the Update Date

2. If yes - Fail the validation

3. If No - No errors.

I tried the following, but none helped.

1. IF(SYSTIME(0) = Update_date, FALSE, TRUE)

2. IF(LEFT(SYSTIME(0),11) < LEFT(Update_date,11),FALSE, TRUE)

I tried with ABS, and changing <> = everything.. but nothing works.

We are using MDM 7.1 SP04. Please let me know, how to implement this.

Thanks,

Priya.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Priya,

Requirement:

1. Check with the System Date is equal to the Update Date

2. If yes - Fail the validation

3. If No - No errors.

Please use this below expression.

IF(LEFT(SYSTIME(0),11) = LEFT(Update Date,11), FALSE, TRUE)

Note: I am using MDM 7.1 SP04, This expression is absolutely working fine at my end.

Kindly revert with result.

Regards,

Mandeep Saini

Former Member
0 Kudos

Hi Mandeep,

Even i tried this. it doesnot work for me.

The behaviour is

1. IF Updated Date = System Date -- then the validation Fails -- Looks fine

2. If the Updated Date is not equal -- then also the validation fails -.--- which is not right.

For me by default... what ever may be the condition, it always executes the THEN part.

Thanks,

Priya.

Former Member
0 Kudos

Hi Priya,

Interesting, I am not able to figure out why this is happening at your end when same expression is working fine at my end.

I am under impression you used the same expression as i suggested above using LEFT function and 11, else it will not give you desired output. Please use the same above expression and Also, make sure that you have selected FALSE and TRUE and = from Operators tab of Expression. Don't write anything except numeric values 0 and 11, Please select field name from Fields tab and IF, SYSTIME and LEFT from Functions tab of Expression. Please check if it helps you out.

Regards,

Mandeep Saini

Former Member
0 Kudos

Hi Mandeep,

I as suggested by you... i have selected them all, not typed anything.

Do you thing this is anyway related to the Time Stamp field.

But i also tried in the Literal Date field, it did not help.

We are in Partch 28 SP 04.

Thanks,

Priya.

Former Member
0 Kudos

Hi Priya,

Do you thing this is anyway related to the Time Stamp field.

No, I am also using Update field of Type Time Stamp and it is working fine for me.

As my patch is different so I am not sure but would suggest check with SAP (raise an OSS Note). It may be a bug also.

Regards,

Mandeep Saini

Answers (1)

Answers (1)

former_member208981
Contributor
0 Kudos

Hi Priya,

Can you please try:

Option 1: IF(LEFT(SYSTIME(0),10) = LEFT(Update Date,10), FALSE, TRUE)

Option 2: In Expressions.. choose Operator= is TRUE ; Value LEFT(SYSTIME(0),10) = LEFT(Update Date,10)

If this does not work, please include what is the Date format you have in Update Date field and System time.

Thanks,

Priti

Former Member
0 Kudos

Hi All,

I think i found the issue.

This Validation works fine -- IF(LEFT(SYSTIME(0),10) = LEFT(Update Date,10), FALSE, TRUE)

if i try to run it manually in the DM, but i make it Automatic Execution error, then always the THEN part is executed, inspite of the condition given.

Have anyone tried this.

Thanks,

Priya.