# days until expiration checkbox

• 0
• Question
• Updated 2 years ago
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!
• 220 Points

Posted 2 years ago

• 0
• 4,430 Points

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)

(Edited)
• 220 Points
That's giving me a syntax error.
• 4,430 Points

will you paste here what you have done?

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

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.

• 220 Points
That appears to have worked.
Thank you so much!
• 556 Points
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.

QuickBaseCoach App Dev./Training, Champion

• 65,472 Points
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])