adding 1 to a value at the start of each month

# Thread: adding 1 to a value at the start of each month

1. Senior Member
Join Date
Dec 1969
Posts
179

## adding 1 to a value at the start of each month

Anyone know how I can add 1 to a value at the beginning of the month? I am tryng to accomplish the following - for the month of September I need the value to be 70, for the month of October I would like to add 1 to that value to make 71. I would like to then add 1 to that number (71) for November making 72. And so on. And so on.<BR><BR>Any idea&#039;s?

2. Senior Member
Join Date
Dec 1969
Posts
259

## RE: Idea, base off number for year...

Idea:<BR><BR>You can base it off 1 number per year...<BR><BR>&#060;%<BR>yearbase = 60<BR><BR>numa = yearbase + month(now)<BR>Response.Write numa<BR>%&#062;<BR>

3. Senior Member
Join Date
Dec 1969
Posts
179

## RE: Idea, base off number for year...

Great idea...that&#039;s probably the easiest way. I&#039;ll just update it each year. Thanks for your help!

4. Senior Member
Join Date
Dec 1969
Posts
96,118

## A better way...

Figure out which month is MONTH #0 in your schem.<BR><BR>You said Oct 2004 is 71? So if I counted correctly, that means that November 1998 is 0.<BR><BR>So just do:<BR> monthNumber = DateDiff( "m", #11/1/1998#, Date() )<BR><BR>Works forever.<BR><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
•