date question

1. Senior Member
Join Date
Dec 1969
Posts
333

## date question

i have the following code to tell me the name of teh current month. <BR><BR>VarMonthName = MonthName(month(date())) <BR><BR>just want to know how i get it to tell me the name of last month or next month..

2. God
Senior Member
Join Date
Dec 1969
Posts
18,177

.

3. Senior Member
Join Date
Dec 1969
Posts
1,032

## RE: date question

NewDate = DateAdd("m", 1, date())<BR><BR>VarMonthName = MonthName(month(newdate))<BR><BR><BR>

4. Senior Member
Join Date
Dec 1969
Posts
2,854

## RE: date question

PreviousMonth = MonthName(month(date())-1) <BR>CurrentMonth = MonthName(month(date()))<BR>NextMonth = MonthName(month(date())+1)

5. God
Senior Member
Join Date
Dec 1969
Posts
18,177

month(#January 1, 2002#)+1 = 13

6. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## Dumbass. I meant December.

Man, I&#039;m tired.

7. Senior Member
Join Date
Dec 1969
Posts
2,854

## RE: Dumbass. I meant December.

True, Could be Handled with either DateAdd(), or <BR><BR>If Month = 12 then Month = 1<BR><BR>OR<BR><BR>For Previous Month, <BR><BR>If Month = 1 then Month = 13<BR><BR>So you wheren&#039;t wrong in the first instance :-)<BR><BR>But anyway, I don&#039;t wanna get flamed like Chops and others yesterday, so I&#039;ll bow out ;-)<BR>

8. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## Heh. No, I meant *I* was..

.. the dumbass. Definately not you.<BR><BR>I&#039;m just incredibly tired this morning and not thinking straight.<BR><BR>It just seems to be a lot of work, the whole IF statements when DateAdd() is a much more simple method. Just my \$0.02 (and, please, don&#039;t ask for change! :) ).

9. Senior Member
Join Date
Dec 1969
Posts
2,854

## PS.

I&#039;ve just done all this stuff for a Calendar App, But the Month switching was all done Client Side with <BR><BR>If Month =1 then <BR>Month = 12<BR>Yesr = Year - 1<BR><BR>Etc etc. you get the picture, so that has maybe caused me to be a little biased :-)

10. Senior Member
Join Date
Dec 1969
Posts
2,854

## Yeah, I know

I was just kidding :-)<BR><BR>if you think about it though, It was a bit of a Dumbass thing not to mention the December January thing in my first Post, so if you had meant me, you wouldn&#039;t have bee wrong :-)<BR><BR>Go get some sleep! :-)<BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•