Help with calculating a date with formula fields

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
This is the first semi-complicated formula I have tried and it is not working!

I have 2 fields that need to be involved in the calculation of Field #3

Field #1 - Date field
Field #2 - Numeric field
Field #3 - Formula - date (should it be something else?)

What I need Field #3 to calculate is this:
Field #1 + (Field #2 * 7)

This seems so simple, but I keep getting errors about mismatched types. I don't understand why Quickbase isn't smart enough to just add a number of days to a date.

Help!!!!!!!!
Photo of Chelsea Harmon

Chelsea Harmon

  • 292 Points 250 badge 2x thumb
  • stupid

Posted 1 year ago

  • 0
  • 1
Photo of Chuck Grigsby

Chuck Grigsby

  • 1,978 Points 1k badge 2x thumb
[Field1] + Days([Field2]*7)

Your formula should work if you change Field2 from numeric to duration
(Edited)
Photo of Chelsea Harmon

Chelsea Harmon

  • 292 Points 250 badge 2x thumb
Now I am getting this error message:

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

The function is defined to be Days (Number n).
Photo of Chuck Grigsby

Chuck Grigsby

  • 1,978 Points 1k badge 2x thumb

[Date] + ([Add Weeks]*7)

Does the formula value look correct? If you just want to add how many weeks are entered in the field then  [Date] + ([Add Weeks])
(Edited)
Photo of Chelsea Harmon

Chelsea Harmon

  • 292 Points 250 badge 2x thumb
Obviously September 5 is not 1 week after July 27, so that formula didn't calculate correctly?
Photo of Chuck Grigsby

Chuck Grigsby

  • 1,978 Points 1k badge 2x thumb
Right because there was the *7 in the formula below the picture, thats why I said if you just wanted to add the number of weeks thats entered in the box, just use [Date] + [Add Weeks]



[Date] + [Add Weeks]

I suggest starting the question with what the end result should be as oppose of technical questions about field type issues in a formula.

Hope this helps resolve your issue! 
Photo of Chelsea Harmon

Chelsea Harmon

  • 292 Points 250 badge 2x thumb
I guess I was trying to make it more complicated than it needed to be! Changing that Duration field to read as weeks makes the *7 redundant, which seems very obvious in hindsight.

I'm always hesitant to be specific about what my form fields are for in a question, as we all use Quickbase and it's functions for very different things.

Thanks so much for all your help, it's working perfectly now!
Photo of Chuck Grigsby

Chuck Grigsby

  • 1,978 Points 1k badge 2x thumb
Completely understandable! If you're feeling generous and want to show support, tips are deeply appreciated and help me, help other people along the way! Take care Chelsea I hope you have a great weekend!

chuck.support/donate

Feel free to reach out directly if you have questions or get stuck on a problem.
chuck@chuck.support