Skip to main content
Solved

DATETIME_DIFF for a specific date

  • June 28, 2020
  • 2 replies
  • 8 views

Forum|alt.badge.img+2

Hi,

I have a formula DATETIME_DIFF(Date,28/06/2020,‘days’) This should give me the number of days between “Date” (a date field) and a specified date. I must have something wrong as it displays 18441 regardless of the date I specify.

What do I need to do?

Cheers

Jason

Best answer by ScottWorld

You can’t just type 28/06/2020 into the formula, because that is seen as either a string of text or a math calculation.

Try using the DATETIME_PARSE function with your 28/06/2020 like this:

DATETIME_PARSE('28/06/2020', 'DD/MM/YYYY')

2 replies

ScottWorld
Forum|alt.badge.img+35
  • Genius
  • Answer
  • June 28, 2020

You can’t just type 28/06/2020 into the formula, because that is seen as either a string of text or a math calculation.

Try using the DATETIME_PARSE function with your 28/06/2020 like this:

DATETIME_PARSE('28/06/2020', 'DD/MM/YYYY')


Forum|alt.badge.img+2

You can’t just type 28/06/2020 into the formula, because that is seen as either a string of text or a math calculation.

Try using the DATETIME_PARSE function with your 28/06/2020 like this:

DATETIME_PARSE('28/06/2020', 'DD/MM/YYYY')


Perfect. That makes sense. Much appreciated.