Skip to main content
Solved

Calculating a date between 2 dates

  • September 6, 2022
  • 2 replies
  • 130 views

I have 2 date fields and would like to calculate the midpoint between the two (as a date). I have tried a few the NGS bit not had any success. Any ideas?

Best answer by Vivid-Squid

Maybe you need to be more accurate than this:

DATEADD(start, DATETIME_DIFF(end, start, 'days')/2, 'days')

Count the number of days between two dates, divide by 2, add that number to the start date.

2 replies

Forum|alt.badge.img+16
  • Inspiring
  • Answer
  • September 6, 2022

Maybe you need to be more accurate than this:

DATEADD(start, DATETIME_DIFF(end, start, 'days')/2, 'days')

Count the number of days between two dates, divide by 2, add that number to the start date.


  • Author
  • New Participant
  • September 8, 2022

Maybe you need to be more accurate than this:

DATEADD(start, DATETIME_DIFF(end, start, 'days')/2, 'days')

Count the number of days between two dates, divide by 2, add that number to the start date.


Thanks. That worked a treat and not something I would have come up with. :slightly_smiling_face: