Aug 22, 2022 03:46 AM
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.
Solved! Go to Solution.
Aug 22, 2022 07:11 PM
I figured it out it didn’t like the curly braces.
Used: DATETIME_DIFF(TODAY(), Birthday, ‘years’)
Thank you!
Aug 22, 2022 04:05 AM
Because TODAY() needs to go first. Formula documentation is here:
Aug 22, 2022 05:06 AM
I tried that, but I get the error message.
Using: DATETIME_DIFF(TODAY(),{Birthday},‘years’)
Aug 22, 2022 06:15 AM
Are you using the correct quotation marks?
DATETIME_DIFF(TODAY(),{Birthday},'years')
Aug 22, 2022 12:19 PM
Yup… I also have the same issue with this formula (getting a negative number).
DATETIME_DIFF({Check-in}, {Check-out},‘days’)
Aug 22, 2022 12:26 PM
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.
Aug 22, 2022 12:46 PM
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.
Aug 22, 2022 12:49 PM
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.
Aug 22, 2022 07:09 PM
Strange - they have worked for other formulas just fine.
Aug 22, 2022 07:11 PM
I figured it out it didn’t like the curly braces.
Used: DATETIME_DIFF(TODAY(), Birthday, ‘years’)
Thank you!