Welcome Guest! | Member Sign in
Search

Hi,

How can you compare 2 datetime variables for the earliest value in the latest CPF build?

When I specify a condition in a decision:
[CustomMessage.CurrentDateTime] < [CustomMessage.ProjectBegindatum] , it's not valid.

When I specify it as
[CustomMessage.CurrentDateTime] <= [CustomMessage.ProjectBegindatum] , it's not valid.

When I specify it as
string([CustomMessage.CurrentDateTime]) <= string([CustomMessage.ProjectBegindatum]) , it's also not valid.

Regards,

Hendrik-Jan van Dalfsen

Comments

Comparing datetime variables

Hi,

Currently, the system tolds, it's valid when validating [CustomMessage.CurrentDateTime] < [CustomMessage.ProjectBegindatum] or [CustomMessage.CurrentDateTime] > [CustomMessage.ProjectBegindatum].

Regards,

Hendrik-Jan van Dalfsen

Re:Comparing datetime variables

Hi Hendrik
You are using custom message in default the custom message will ba a single line text . To compare the dates the field will be date field . Make these field as an application object as date field. Then it works fine.

Regards
Nizar

Comparing datetime variables

Hi Nizar,

That works for comparing application object fields.
But how can you compare a datetime application object field with Currentdatetime?
First you have to concat the CurrentDate with 'T' and CurrentTime system variables. After that, you can compare it.

Or do you have to do it in 2 steps?
First compare datetime application object field with CurrentDate and if it's the same date, compare the datetime application object field for the CurrentTime?
But, in that case, can you compare the time of a Datetime application object field with CurrentTime?

Regards,

Hendrik-Jan van Dalfsen

current date

Hi Hendrik

If you compare the current date it takes the current time also . So no need to compare the date and time seperately.
Regards
Nizar