Comparing two run dates [6.1.1] - VisualCron - Forum

Community forum

Brett
  •  Brett
  • No customer Topic Starter
2012-05-22T23:02:39Z
Hi Support - could you provide some suggestion on the best way to test a run date:time format as being greater than a stored value of the same.

Format is 2012-05-22T09:19:27+10:00

I am trying to control a loop using these values

However I can't test a string as greater than a previous string in the loop condition

Chopping the string into its numeric components and trying to place them into a variable always results in a string even if the variable is defined as numeric - it is converted back to string.

so a variable double - set to be assigned the output of

{STRING(Left|{USERVAR(support)}|4)}{STRING(Substring|{USERVAR(support)}|5|2)}{STRING(Substring|{USERVAR(support)}|8|2)}{STRING(Substring|{USERVAR(support)}|11|2)}{STRING(Substring|{USERVAR(support)}|14|2)}

Which gives 201205220919

is converted back to a string - even though when the statement is resolved the resulting value is a numeric.

Trying to work this out was why I ended up in the variable issue before - so this time I thought I would ask. 😁

Thanks
Brett.
Support
2012-05-24T09:12:59Z
Variables are always strings in their format. You could convert the Variable to a User Variable which have different value types. Or, you could use the Variable Condition to compare two Variables in a numeric way.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Brett
  •  Brett
  • No customer Topic Starter
2012-05-29T00:10:45Z
Hi - Thanks for the feedback - the first option I don't seem to be able to get to work - the second option does although it would be easier if I could just do this check using the loop condition - rather than having to test the dates and set a flag for the loop, so that it can test to see if it should finish.

If I try creating a user variable as a numeric and assigning it the value from a string function it refuses to accept the assignment when editing the set variable task - insists that the variable type must be string even if the output of the function is a numeric string. If I leave it set to string in the set variable task it converts the user variable to string type even if it is created as numeric.




Thanks
Scroll to Top