KAPOW

Would you like to react to this message? Create an account in a few clicks or log in to continue.
KAPOW

Welcome to the Kapow forum. Here you can get help, use your skills to help others and enjoy hanging out in the company of other Kapow Robot Developers.


2 posters

    Between two dates.

    avatar
    andobe


    Posts : 14
    Points : 1900
    Join date : 2019-03-22

    Between two dates.  Empty Between two dates.

    Post by andobe Fri Jun 28, 2019 8:19 pm

    Hello everyone,

    I am trying to get an output if it matches a time between tow dates.

    So let's say the date is between 2019-06-13 - 2019-07-12, then th out put needs to be A. And if the date is between 2019-07-13 - 2019-08-12 then the output needs to be B. And etc. etc. 

    Does anybody know a way to do this? 

    Thanks in advance for all the help!
    batman
    batman


    Posts : 47
    Points : 1922
    Join date : 2019-03-19

    Between two dates.  Empty Re: Between two dates.

    Post by batman Mon Jul 01, 2019 4:26 pm

    There are a number of inbuilt date converters and functions available that will allow you to do this.

    If you take your input date and run it through a 'Get Times between Dates' converter this will give you the number of days between your input and target date. Assign this to a difference variable, then do the same for your second date. When configuring your converter make sure you check the 'Get Signed Difference' checkbox to give you negative values for the date differences.

    You can then check if your input date lies between the two by making sure one is positive and the other negative. If it fails then repeat the process for the second set of dates and return the output accordingly.

    Setting up the converters.. assign the results to DateDiff1 and DateDiff2 variables.
    Between two dates.  Date_d10

    Between two dates.  Date_d11

    Add a test against the two differences, if it matches then output A otherwise try again for the next set of dates. If that one doesn't match then do some error handling. Tests are just test actions using
    Between two dates.  Datedi10
    avatar
    andobe


    Posts : 14
    Points : 1900
    Join date : 2019-03-22

    Between two dates.  Empty Re: Between two dates.

    Post by andobe Mon Jul 01, 2019 4:32 pm

    Hi and thank you Batman!

    I thought about this but since the input will be text i couldnt use it.

    I used instead converters and IF THEN where i used MATCH PATTERN:
    ^(202)\d([-])(1[2])\2(0[1-9]|[1][0-7])$

    Which worked very smoothly.

    Sponsored content


    Between two dates.  Empty Re: Between two dates.

    Post by Sponsored content


      Current date/time is Sun Apr 28, 2024 6:34 am