Discussions

Expand all | Collapse all

days until expiration checkbox

  • 1.  days until expiration checkbox

    Posted 04-05-2017 18:23
    I have a checkbox that is functioning almost as its supposed too.

    If(Today()>=([Expiration]-Days(45)), true and [Customer Status] = "Closed" and [Health Term] > 30)

    I want the box to be checked if we are within 45 days of the policy expiration date and it does this. The issue is if the expiration date has passed the box doesn't unchecked.
    Any assistance would be appreciated.
    Thanks!


  • 2.  RE: days until expiration checkbox

    Posted 04-05-2017 18:30

    Because Today() will continue to be greater than the expiration term. so you have to set a range.

    Let's try this:

    If(Today()>=([Expiration]-Days(45) AND Today()<=[Expiration]), true and [Customer Status] = "Closed" and [Health Term] > 30)



  • 3.  RE: days until expiration checkbox

    Posted 04-05-2017 18:45

    Would you not want to reconstruct this statement thusly?

    If(Today()>=([Expiration]-Days(45) AND Today()<=[Expiration]) and [Customer Status] = "Closed" and [Health Term] > 30,true,false)



  • 4.  RE: days until expiration checkbox

    Posted 04-05-2017 20:37
    That's giving me a syntax error.


  • 5.  RE: days until expiration checkbox

    Posted 04-05-2017 20:38

    will you paste here what you have done?




  • 6.  RE: days until expiration checkbox

    Posted 04-05-2017 20:39
    If(Today()>=([Expiration]-Days(45) AND Today()<=[Expiration]) and [Customer Status] = "Closed" and [Health Term] > 30,true,false)


  • 7.  RE: days until expiration checkbox

    Posted 04-05-2017 20:43

    Can we try this without the parentheses around the date range like so:


    If(
    Today()>=[Expiration]-Days(45) AND Today()<=[Expiration] and [Customer Status] = "Closed" and [Health Term] > 30,true,false
    )


    If you get another syntax error, please tell us what is says.



  • 8.  RE: days until expiration checkbox

    Posted 04-05-2017 20:45
    That appears to have worked.
    Thank you so much!


  • 9.  RE: days until expiration checkbox

    Posted 09-15-2017 21:31
    I am trying a similar thing, but not having any luck. 

    If(
    (not IsNull([Date Completed]) and [Status]="Completed"),[Date Completed],[Date Modified])


    This is what it says:

    The types of the arguments or the number of arguments supplied do not meet the requirements of the function If.

    The function is defined to be If (Boolean condition1, result1, ..., else-result).

    You may need to do one of the following to fix the problem:
    • Choose the right number and type of arguments.
    • Use a type conversion function to convert the arguments you are using to the correct type.
    • Choose a different function.


  • 10.  RE: days until expiration checkbox

    Posted 09-15-2017 22:09
    I would check the field types of your two result conditions. I suspect that one of them is a date field and the other one might be a date/time field.

    You need to decide what field type your formula is for and make sure that the results tmatch that.

    You probably have to convert the date modified fieldto be a date field.

    ToDate([Date Modified])