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())
Months betwen dates
-
- 3StarLounger
- Posts: 250
- Joined: 01 Mar 2010, 17:34
- Location: Blue Springs, MO
Months betwen dates
Morgan
-
- Administrator
- Posts: 78236
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Months betwen dates
Use
DateDiff("m",StartDate,Date())+(Day(StartDate)>Day(Date()))
DateDiff("m",StartDate,Date())+(Day(StartDate)>Day(Date()))
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 250
- Joined: 01 Mar 2010, 17:34
- Location: Blue Springs, MO