Months betwen dates

User avatar
Abraxus
3StarLounger
Posts: 250
Joined: 01 Mar 2010, 17:34
Location: Blue Springs, MO

Months betwen dates

Post by Abraxus »

I have a query that takes a date and is supposed to calculate the number of months between today and that date.

I also am calculating the number of days between those dates.

What I'm seeing is that something with a start date of 2/26/2020 shows 22.44856 days, but also shows 1 month. I would expect 0 months.

Is there a better (more accurate) way than DateDiff("m",StartDate,Now())
Morgan

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Months betwen dates

Post by HansV »

Use

DateDiff("m",StartDate,Date())+(Day(StartDate)>Day(Date()))
Best wishes,
Hans

User avatar
Abraxus
3StarLounger
Posts: 250
Joined: 01 Mar 2010, 17:34
Location: Blue Springs, MO

Re: Months betwen dates

Post by Abraxus »

Thank you so much!
Morgan