Skip to main content
Solved

DATETIME_DIFF Formulas Help Needed! Negative Numbers

  • August 22, 2022
  • 10 replies
  • 64 views

Forum|alt.badge.img+3

Why are all my DATETIME_DIFF formulas coming up as a negative number?

My formula is: DATETIME_DIFF({Birthday}, TODAY(), ‘years’) and I am getting for example -29 instead of 29.

Best answer by Penny_Bell

I figured it out it didn’t like the curly braces.

Used: DATETIME_DIFF(TODAY(), Birthday, ‘years’)

Thank you!

10 replies

ScottWorld
Forum|alt.badge.img+35
  • Genius
  • August 22, 2022

Because TODAY() needs to go first. Formula documentation is here:


Forum|alt.badge.img+3
  • Author
  • Inspiring
  • August 22, 2022

Because TODAY() needs to go first. Formula documentation is here:


I tried that, but I get the error message.

Using: DATETIME_DIFF(TODAY(),{Birthday},‘years’)


Mohamed_Swella1
Forum|alt.badge.img+17

I tried that, but I get the error message.

Using: DATETIME_DIFF(TODAY(),{Birthday},‘years’)


Are you using the correct quotation marks?

DATETIME_DIFF(TODAY(),{Birthday},'years')


Forum|alt.badge.img+3
  • Author
  • Inspiring
  • August 22, 2022

Are you using the correct quotation marks?

DATETIME_DIFF(TODAY(),{Birthday},'years')


Yup… I also have the same issue with this formula (getting a negative number).

DATETIME_DIFF({Check-in}, {Check-out},‘days’)


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • August 22, 2022

Yup… I also have the same issue with this formula (getting a negative number).

DATETIME_DIFF({Check-in}, {Check-out},‘days’)


Once again, you’re doing it incorrectly. As I explained above, you need to put the later date first, not the earlier date first.

If you’re getting an error message, than please explain what error message you’re getting and please give a screenshot to go with it.

You’re not giving enough information for us to help you. We can’t just guess what sort of error you’re getting.


Forum|alt.badge.img+3
  • Author
  • Inspiring
  • August 22, 2022

Ok, so it worked with this formula putting the date first: DATETIME_DIFF({Check-out}, {Check-in}, ‘days’).

But for this formula: DATETIME_DIFF(TODAY(),{Birthday},‘years’) and DATETIME_DIFF(TODAY(), {Birthday}, ‘years’)
I got the attached error message.


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • August 22, 2022

Ok, so it worked with this formula putting the date first: DATETIME_DIFF({Check-out}, {Check-in}, ‘days’).

But for this formula: DATETIME_DIFF(TODAY(),{Birthday},‘years’) and DATETIME_DIFF(TODAY(), {Birthday}, ‘years’)
I got the attached error message.


It’s because, as @Mohamed_Swellam pointed out above, you are using stylized quotation marks around the word years. Airtable only recognizes straight quotes, not curly quotes.


Forum|alt.badge.img+3
  • Author
  • Inspiring
  • August 23, 2022

It’s because, as @Mohamed_Swellam pointed out above, you are using stylized quotation marks around the word years. Airtable only recognizes straight quotes, not curly quotes.


Strange - they have worked for other formulas just fine.


Forum|alt.badge.img+3
  • Author
  • Inspiring
  • Answer
  • August 23, 2022

I figured it out it didn’t like the curly braces.

Used: DATETIME_DIFF(TODAY(), Birthday, ‘years’)

Thank you!


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • August 23, 2022

I figured it out it didn’t like the curly braces.

Used: DATETIME_DIFF(TODAY(), Birthday, ‘years’)

Thank you!


No, the curly braces had nothing to do with it. It was the quotation marks that were the problem.