Dave Eyley
Registered User.
- Local time
- Today, 08:34
- Joined
- Sep 5, 2002
- Messages
- 254
Using Date1 and Date2 as user inputs I use DateDiff() to give me the months difference...
Me!TM=DateDiff("m",Date1,Date2)
But the results are not quite what I expect...
If I enter Date1 as 01/08/2004 (dd/mm/yyyy)
and enter Date2 as 31/07/2005 (dd/mm/yyyy)
I get a count of 11 months, not 12 as expected.
But then if I enter Date 1 As 01/08/2004
and enter Date 2 as 28/02/2005
I get a count of 6 months as I would expect...
So, I thought, add a day to date2 to compensate...
Doing that gives me 12 months for the year count but 7 months for the 6 month count!!!
Any suggestions? Give up Access, perhaps?
Dave Eyley
Me!TM=DateDiff("m",Date1,Date2)
But the results are not quite what I expect...
If I enter Date1 as 01/08/2004 (dd/mm/yyyy)
and enter Date2 as 31/07/2005 (dd/mm/yyyy)
I get a count of 11 months, not 12 as expected.
But then if I enter Date 1 As 01/08/2004
and enter Date 2 as 28/02/2005
I get a count of 6 months as I would expect...
So, I thought, add a day to date2 to compensate...
Doing that gives me 12 months for the year count but 7 months for the 6 month count!!!
Any suggestions? Give up Access, perhaps?
Dave Eyley
Last edited: