Forum Discussion

ArchiveUser's avatar
ArchiveUser
Qrew Captain
8 years ago

Help with calculating a date with formula fields

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!!!!!!!!
  • [Field1] + Days([Field2]*7)

    Your formula should work if you change Field2 from numeric to duration
  • 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).
    • ChuckGrigsby's avatar
      ChuckGrigsby
      Qrew Cadet
      What field types do you have now?
      Field #1 - Date field
      Field #2 - Numeric field
      Field #3 - Formula - date
      If its like your original post then the formula date should be this
      [Field1] + Days([Field2]*7)

      If its like this
      Field #1 - Date field
      Field #2 - Duration field
      Field #3 - Formula - date

      formula would be this
      [Field1] + ([Field2]*7)
    • ArchiveUser's avatar
      ArchiveUser
      Qrew Captain
      I thought that solved it, but when I actually tried it with values it is calculating completely incorrectly.

      The fields are:
      Field #1 - Date field
      Field #2 - Duration field
      Field #3 - Formula - date

      The formula is:

      [Field #1] + ([Field #2]*7)

      The Duration field is representative of weeks (1 week, 2 weeks, etc.)

      This formula is supposed to take a start date and calculate a due date that is X weeks later.

      The Duration field has a value display dropdown option for weeks, which is what I selected (although I'm not sure what affects). This seems like it should work, I am at a loss as to why it does not.

      Also, I really appreciate your help!
    • ChuckGrigsby's avatar
      ChuckGrigsby
      Qrew Cadet

      [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])