Quick Date If condition question


#1

Greetings, I’m looking for the correct Condition to place in the If activity.

Scenario: I have a Date variable that gives me to dates. Example(10/30/16 - 10/30/2017)
I then use the split string activity to give me the first date (10/30/16) = Variable ,
I then wish to compare this with today’s date in if activity. For some reason It seems to be backwards on the results

useDate(0).tostring < today.Date.ToShortDateString.

Then = "Old date"
Else = “New date”

Any help on a new way to work this would be great. More details below

original data (read cell date) Variable Name Dates. Variable type String
Split string activity on (Dates) variable. Results useDate
useDate Variable Type String[ ]


#2

Hi,

Your condition needs to be comparing dates, so you need to convert them to DateTime types.

cdate(useData(0).Trim) < Now

That’s just a quick way of doing it. cdate is the same as Convert.ToDate


#3

Great, let me give that a go. I thought the “.tostring” may have caused and issue.


#4

Appreciate you @ClaytonM Worked like a charm. Thanks!!

:fist_right::fist_right::fist_right: