Matty
...the Myth Buster
- Local time
- Today, 03:33
- Joined
- Jun 29, 2001
- Messages
- 396
Hi,
I have a question about counting the number of months between two dates. The user enters a Start Date and Expiry Date, and I need to make sure those dates are exactly whole months. For example January 1, 2005 to March 31, 2005 gives me exactly 3 months. But January 1, 2005 to April 1, 2005 will give me 3 months plus a day.
I tried to do a DateDiff on that second date range, but it gives me 4. Is there some way for me to get a result of 3 months and 1 day? Or at least allow me to count the number of whole months? If I get the number of whole months, I can do some math to figure out the extra days.
Thanks in advance,
-Matt
I have a question about counting the number of months between two dates. The user enters a Start Date and Expiry Date, and I need to make sure those dates are exactly whole months. For example January 1, 2005 to March 31, 2005 gives me exactly 3 months. But January 1, 2005 to April 1, 2005 will give me 3 months plus a day.
I tried to do a DateDiff on that second date range, but it gives me 4. Is there some way for me to get a result of 3 months and 1 day? Or at least allow me to count the number of whole months? If I get the number of whole months, I can do some math to figure out the extra days.
Thanks in advance,
-Matt