cancel
Showing results for 
Search instead for 
Did you mean: 

Comparin System Date with a Date field

former_member226173
Active Participant
0 Kudos

Hi ,

I want to compare system date and another date field , if the Date field < system date then result should be true else false , but if the date field and system date is the same i want the result to be false, Please suggest

i have this in my validation expression now

(ABS(SYSTIME(0)) > ABS(DATEFIELD))

Accepted Solutions (1)

Accepted Solutions (1)

former_member226173
Active Participant
0 Kudos

Hi Shiv

The problem is this will return a TRUE value system date >= datefield, but i want a FALSE value , Any suggestion.

former_member205403
Active Contributor
0 Kudos

Ok, but what about your expression. It should return FALSE if sysem date is same as date field.

is it something like not working as expected?

Best Regards,

Shiv

former_member226173
Active Participant
0 Kudos

Hi Shiv,

The problem is that if the systemdate = datefield it returns as true where as i want a false value.

I think its because i'm using SYSTIME(0) , it's comparing the system date and time both with the datefield. naturally it will be greater.

is there any way to get only the systemdate .

Former Member
0 Kudos

Hi Vag,

Please try below expression:

IF(LEFT(SYSTIME(0),11) > LEFT(datefield,11), TRUE, FALSE)

Kindly revert with result. This is working fine at my end.

Regards,

Mandeep Saini

former_member226173
Active Participant
0 Kudos

Hi Mandeep

Thanks a lot , that works well. is it that the SYSTIME(0) get the date and time both . Please explain ur code

Former Member
0 Kudos

Hi Vig,

As you asked: I think its because i'm using SYSTIME(0) , it's comparing the system date and time both with the datefield. naturally it will be greater. is there any way to get only the systemdate .

Please explain ur code

Logic is simple: As SYSTIME(0) returns both date and time i.e YYYY:MM:DD:TIME

So in my logic i use LEFT(SYSTEIME(0),11) which returns only date 11 chars upto YYYY:MM:DD: and other side also LEFT(datefield, 11) returns date and hence only date is getting compared. So I am comparing only the systemdate of SYSTIME(0) with date of datefield.

Kindly revert if you still have any doubts.

Regards,

Mandeep Saini

Former Member
0 Kudos

Hello,

my requirement is such that i need to have a Valid to Date as 31/31/9999,

I tried using left(systime(0),11) which will give me for eg, 12/10/2010, which i need to change to 31/31/9999

How do i achieve this.

thank you in advance

former_member226173
Active Participant
0 Kudos

Hi Abhi,

Please Hard code the value if u want the end date ,

(31/12/9999) - No left is required .

Hope it helps

Former Member
0 Kudos

Hi,

I just saw your thread regarding the Data comparison.

I am also trying to achieve the same functionality. But this doesnot work for me. Please can anyone help me.

Requirement:

1. If Updated Date is not to today's date - then validation is TRUE else FALSE.

2. Update Date is of type Time stamp.

We are using MDM 7.1 SP04

Thanks,

Priya.

former_member226173
Active Participant
0 Kudos

Hi Priya,

1. If Updated Date is not to today's date - then validation is TRUE else FALSE

IF (Updated date = SYSTIME(0),FALSE,TRUE)

Hope this Helps

Answers (1)

Answers (1)

former_member205403
Active Contributor
0 Kudos

Hi,

I didn't check into the system but did you tried this:

(ABS(SYSTIME(0)) > =ABS(DATEFIELD))

Best Regards,

Shiv