Here is some code for selecting dates on a quarterly basis. Any questions let me know:
ldMonth = MONTH(DATE())
ldJanDate = GOMONTH(DATE(), -(MONTH(DATE()) -1))
ld_Q1_FromDate = DTOC(ldJanDate - (DAY(ldJanDate) - 1))
ldThreeMonthLater = GOMONTH(ldJanDate,3)
ldSixMonthLater = GOMONTH(ldJanDate,6)
ldNineMonthLater = GOMONTH(ldJanDate,9)
ldTwevMonthLater = GOMONTH(ldJanDate,12)
** The First Date of the following month will be:
** DTOC(ldTwoMonthLater - (DAY(ldTwoMonthLater) - 1))
** We got the required "ld_Q1_ToDate" which is
** the last date of the first quarter of this year
ld_Q1_ToDate = DTOC(ldThreeMonthLater - (DAY(ldThreeMonthLater) - 1) -1)
ld_Q2_FromDate = DTOC(ldThreeMonthLater - (DAY(ldThreeMonthLater) - 1) )
ld_Q2_ToDate = DTOC(ldSixMonthLater - (DAY(ldSixMonthLater) - 1) -1)
ld_Q3_FromDate = DTOC(ldSixMonthLater - (DAY(ldSixMonthLater) - 1) )
ld_Q3_ToDate = DTOC(ldNineMonthLater - (DAY(ldNineMonthLater) - 1) -1)
ld_Q4_FromDate = DTOC(ldNineMonthLater - (DAY(ldNineMonthLater) - 1) )
ld_Q4_ToDate = DTOC(ldTwevMonthLater - (DAY(ldTwevMonthLater) - 1) -1)
lcmonth = CMONTH(DATE( )) && The month today
DO CASE && Begins loop
CASE INLIST(lcmonth,'January','February','March')
This.parent.txtstartdate.Value = CTOD(ld_Q1_FromDate)
This.parent.txtenddate.Value = CTOD(ld_Q1_ToDate)
CASE INLIST(lcmonth,'April','May','June')
This.parent.txtstartdate.Value = CTOD(ld_Q2_FromDate)
This.parent.txtenddate.Value = CTOD(ld_Q2_ToDate)
CASE INLIST(lcmonth,'July','August','September')
This.parent.txtstartdate.Value = CTOD(ld_Q3_FromDate)
This.parent.txtenddate.Value = CTOD(ld_Q3_ToDate)
OTHERWISE
This.parent.txtstartdate.Value = CTOD(ld_Q4_FromDate)
This.parent.txtenddate.Value = CTOD(ld_Q4_ToDate)
ENDCASE && Ends loop
>I need to create a form Based on a start date and an end date.
>Example 7/01/99 to 9/01/99 the form would show:
>
> July August September
>
>
>
>
>
>So one Label and two txtboxes for each month between the start date and end date. This would very with the months between dates.
>
>I've tried a DO WHILE with and addobject but I only end up with one series. I can create an array of object but how do I work with the array to get what I want on the form. I've always been weak on arrays.
>
>Any Ideas or help would be appreciated. maybe someone has already writen some code or has a class to accomplish this.
>
>Thanks
>
>Keith Hartman
>khartman@ais.net
Thanks
Jim