Calculating Specifics

1. Junior Member
Join Date
Dec 1969
Posts
12

## Calculating Specifics

I have what most likely is a very simple issue, but I seem<BR>to be dealing with fuzzy math or a fuzzy brain :)<BR><BR>I have the numbers: 1 - 29<BR>If today is 10, I wish to display three additional numbers<BR>but they must be in increments of 7. For example:<BR><BR>10 17 24 2<BR>or using 14 as a base<BR>14 21 28 6<BR><BR>The "2" or "6" is where I am stumped. I need to start over when<BR>I reach the end, and 24+7 needs to equal 2, and 28+7 needs to<BR>equal 6.

2. Senior Member
Join Date
Dec 1969
Posts
473

## RE: Calculating Specifics

Dim today, increment<BR>today=datePart("d", now())<BR>increment=7<BR>today1=today+increment*1< BR>today2=today+increment*2<BR>today3=today+increm ent*3<BR>If today1&#062;29 then<BR>today1=today1-29<BR>elseif today2&#062;29 then<BR>today2=today2-29<BR>elseif today3&#062;29 then<BR>today3=today3-29<BR>end if<BR>response.write today1&" "&today2&" "&today3<BR><BR>Hope this does it<BR>Mazza :)<BR><BR>

3. Junior Member
Join Date
Dec 1969
Posts
12

## RE: Calculating Specifics

That did it!<BR><BR>Thanks so much...

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

## way too complicated!

&#060;%<BR>today = Day( Date() ) - 1<BR>For day = today To today + 21 Step 7<BR>&nbsp; &nbsp; Response.Write " " & ( 1 + (day MOD 29) )<BR>Next<BR>%&#062;<BR><BR>I have to admit to curiosity as to why you wrap around at 29 instead of at however many days there are in the current month. Any reason?<BR><BR>

5. Junior Member
Join Date
Dec 1969
Posts
12

## RE: way too complicated!

Yessir!<BR><BR>The moon has a 29 day cycle :)<BR><BR>Thanks also for your response. You have been there for me in the<BR>past, as have many others in the forum. It is nice to know the<BR>answer is just a click away!!<BR><BR>Michael

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

## Ummm...29.53 days!

So, actually, it&#039;s just barely closer to 30 days than it is to 29.<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
•