Restricting entries within dates pulled from csv

I’m using pulldata to pull 2 dates from a CSV file, and I need to make sure that ${today} (the date of survey) is within those 2 dates. If not, I want to display a message to the user.

I have tried to do a regular comparison in the skip logic of the message, like this:

${today} < ${date1} and ${today} > ${date2}

But for some reason, it does not work. What would be the right way to do this?

Hello @ks_1 ,
Could you try to localise/track the problem, please:

  • What are the values of today, date1 and date2? (Show them with a note.)
  • Does it work, if you set (entry, default, calculate) date1 and date2, instead of the csv import?
  • What are the types of today, date1 and date2?
  • Is today the metadata variable?
2 Likes

For example:

${today} = '2022-05-30'
${date1} = '2022-05-31'
${date2} = '2022-06-02'

I expect this to work, however I need to use the pulldata values.

today is the metadata variable, and date1 and date2 are string values because anything coming from pulldata is a string. AFAIK even today is a string.

Hello,
the hints were only to localise the problem.

This results in FALSE - as expected.

Maybe the mathematical comparison < and > on the strings creates a problem. You may try with casting to date( ${date1} ) etc.

1 Like