Time filter

Comments

1 comment

  • Alan

    Hi Pouria,

    I'm seeing a logical error in the description, you're suggesting a time before 8am and after 8:20am - no time within the same day could ever meet this criteria.  I think you mean some time greater than 8am but not after 8:20am.  I'll follow this assumption in my example below.

    You will need to use an Advanced Filter to achieve your goal here.

    Step 5 on the documentation contains an example formula that you can use to meet your goals by combining two statements with AND requirements then using an OR to combine them.  You'll note the usage of Operators to shorten the statements where && is AND and || is OR.

    The last bit of the problem is providing a compatible date value to compare against another date value.  This can be achieved with the ASDATE Function.

    (#Timecolumn > ASDATE(datestringparse pattern) && #Timecolumn < ASDATE(datestring2parse pattern)) || (#Timecolumn > ASDATE(datestring3parse pattern) && #Timecolumn < ASDATE(datestring4parse pattern)) 

    So in plain words that's check to see:
    If Time column is greater than datestring and Time column is less than datestring2 
    OR 
    If Time column is greater than datestring3 and Time column is less than datestring4

    You can continue to extend your filter criteria by adding operators as necessary to build your filter criteria.

    Hopefully this gets you moving forward!

    Alan

     

    0
    Comment actions Permalink

Please sign in to leave a comment.