CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 display 1st day of month, monthyl interval skip

Print topic Send  topic

Author Message
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...
_________________
(\__/)
(='.'=)
(")_(")
View profile  Send private message
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
_________________
(\__/)
(='.'=)
(")_(")
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.