Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Month calulation issue
#1
Solved: 10 Years, 10 Months ago
Currently I have the following code:

Code:
intMonth = Month(Now)                          ' 9
ThisMonth = MonthName(intMonth)           ' "September"
Min1Month = MonthName(intMonth - 1)     ' "August"
Min6Month = MonthName(intMonth  - 6)

As is (which i just now found out in January) that when Now = 1, thus intMonth = 1, and Min1Month = 0.

When Now is <= 6, thus Min6Month = -5 to 0

What code is approprioate to use in both cases? How can I keep Min1Month and Min6Month between 1 and 12?

I have tried a few wzys other than going to a If Then for each case.

Thoughts?
Reply


Messages In This Thread
Month calulation issue - by mv8167 - 01-05-2012, 01:24 AM
RE: Month calulation issue - by vIns - 01-05-2012, 08:50 AM
RE: Month calulation issue - by mv8167 - 01-05-2012, 08:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Month name select from WebList Box kamalakannan_anandan 2 4,061 07-06-2011, 09:52 AM
Last Post: rajpes

Forum Jump:


Users browsing this thread: 1 Guest(s)