ryan
Posts: 41
|
Posted: 06/01/2004, 12:26 AM |
|
Is there any nifty script monthly by DATE, the interval is month for instance:
Today is June 1, 2 monthly interval therefore it displays
June 1, Aug 3, Oct 5 ... (every 1st Tuesday, 2 monthly interval/2 month skips)
June 2 , 5 monthly interval therefore it displays
June 2, November 3, April 7 ... (every 1st Wenesday, monthly interval/5 month skips)
If this monthly interval is feasible would it also be feasible to apply yearly interval
The date ranges are inputted DATEFROM and DATETO, then the interval I do not know if array is the righ approach or datepart, dateadd.
Much obliged...
_________________
(\__/)
(='.'=)
(")_(") |
|
|
ryan
Posts: 41
|
Posted: 06/03/2004, 1:29 AM |
|
got it thanx everyone
ChooseDate = "6/13/2004" 'Date()
ChooseUntil = "11/30/2004"
Interval = 2 : ChooseUntil = CDate( ChooseUntil ) : ChooseDate = CDate(ChooseDate)
jk = ChooseDate
DO
IF DatePart("w",jk) = DatePart("w",ChooseDate) THEN
keepjk = keepjk & jk & ","
END IF
jk = jk + 1
LOOP UNTIL jk > ChooseUntil
i=0:arrjk = Split (keepjk,",")
DO
Response.Write(arrjk(i)&"<br>")
i = i + CountSMth (Month(ChooseDate),Interval)
LOOP UNTIL i > UBound(arrjk)
Function AssignMonthWkCount (byMonth)
SELECT CASE byMonth
CASE 1,4,7,10 : AssignMonthWkCount = 5
CASE ELSE : AssignMonthWkCount = 4
END SELECT
End Function
Function CountSMth (Mstrt,Interval)
dim ii,ij,ctval
ij = Mstrt+1
DO
'Response.Write(ii&" ")
ii = ii + AssignMonthWkCount (ij)
ij = ij + 1 : ctval = ctval + 1
LOOP UNTIL ctval > Interval-1
CountSMth = ii
End Function
_________________
(\__/)
(='.'=)
(")_(") |
|
|
|
|
|
|
|