Cool but playing with this one first I seem to not know the diffence in
the months And the last months was alwas the VAR endmonth in each for
loop
@esleif to track frist month in and last month out and month in the
middle are 12. and thanks for you help/insight!
>From before
local$startdate 03/01/1999 local$enddate 06/30/2000
local$thisyear: 1999 1999
local$thismonth: 3
local$thismonth: 4
local$thismonth: 5
local$thismonth: 6
local$thisyear: 2000 2000
local$thismonth: 1
local$thismonth: 2
local$thismonth: 3
local$thismonth: 4
local$thismonth: 5
local$thismonth: 6
as you can see the first loop stoped on month ^ and did not finish on 12
now I get
local$startdate 03/01/1999 local$enddate 06/30/2000
local$thisyear: 1999 1999
local$thismonth: 3
local$thismonth: 4
local$thismonth: 5
local$thismonth: 6
local$thismonth: 7
local$thismonth: 8
local$thismonth: 9
local$thismonth: 10
local$thismonth: 11
local$thismonth: 12
local$thisyear: 2000 2000
local$thismonth: 1
local$thismonth: 2
local$thismonth: 3
local$thismonth: 4
local$thismonth: 5
local$thismonth: 6
Sample from new layout
<pre>
<FORM METHOD="POST" ACTION="<@APPFILE>?_function=list">
<TABLE BORDER=0>
<TR VALIGN=TOP ALIGN=LEFT> <TD>
Matched date:
</TD>
<TD>
<INPUT NAME="matcheddate1" TYPE=TEXT SIZE=10 MAXLENGTH=10
VALUE="<@ARG matcheddate1>">
</TD>
</TR>
<TR VALIGN=TOP ALIGN=LEFT> <TD>
Matched date 1:
</TD>
<TD>
<INPUT NAME="matcheddate2" TYPE=TEXT SIZE=10 MAXLENGTH=10
VALUE="<@ARG matcheddate2>">
</TD>
</TR>
</TABLE>
<INPUT TYPE=SUBMIT VALUE="Find"> <INPUT TYPE=RESET VALUE="Reset Values">
</FORM>
</center>
<@ASSIGN local$startdate <@ARG matcheddate2>>
<@ASSIGN local$enddate <@ARG matcheddate1>>
<@IF EXPR='<@DATETOSECS DATE="@@local$enddate"> < <@DATETOSECS
DATE="@@local$startdate">'>
<@! COMMENT=" Swap Start/End Date">
<@ASSIGN local$startdate <@ARG matcheddate1>>
<@ASSIGN local$enddate <@ARG matcheddate2>>
</@IF>
local$startdate @@local$startdate <@VAR @@local$startdate FORMAT="">
local$enddate @@local$enddate <BR>
<@FOR START='<@VAR local$startdate format="datetime:%Y">' STOP='<@VAR
local$enddate format="datetime:%Y">'>
<@ASSIGN local$getforyear <@CURROW>>
<@! COMMENT=" for each year ">
<@ASSIGN local$thisyear <@CURROW>>
local$thisyear: @@local$thisyear <@CURROW><BR>
<@IFEQUAL <@VAR local$startdate format="datetime:%Y"> <@CURROW>>
<@! COMMENT=" Start month from startdate ">
<@ASSIGN local$startmonth <@VAR local$startdate
format="%m">>
<@ELSE>
<@! COMMENT=" Start month is 1 ">
<@ASSIGN local$startmonth 1>
</@IF>
<@IFEQUAL <@VAR local$enddate format="datetime:%Y"> <@CURROW>>
<@! COMMENT=" End month from enddate ">
<@ASSIGN local$endmonth <@VAR local$enddate
format="%m">>
<@ELSE>
<@! COMMENT=" End month is 12 ">
<@ASSIGN local$endmonth 12>
</@IF>
<@! added JH>
<@IF "@@local$getforyear = <@VAR local$enddate
format='datetime:%Y'>">
<@ASSIGN local$stopfor <@VAR local$enddate
format='datetime:%m'>>
<@ELSEIF "@@local$getforyear = <@VAR
local$startdate format='datetime:%Y'>">
<@ASSIGN local$stopfor 12>
<@ELSEIF "@@local$getforyear != <@VAR
local$startdate format='datetime:%Y'>" || "@@local$getforyear = <@VAR
local$enddate format='datetime:%Y'>">
<@ASSIGN local$stopfor 12>
</@IF><@! added JH>
<@FOR START="<@VAR local$startmonth format="%Y">" STOP="<@VAR
local$stopfor format='datetime:%m'>">
<@! COMMENT="for each month in this year">
local$thismonth: <@CURROW><BR>
<@! COMMENT=" calculate the month start/ month ending
here ">
</@FOR>
</@FOR>
</pre>
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:owner-witango-talk@;witango.com] On Behalf Of Anthony M.
Humphreys
Sent: Monday, November 04, 2002 1:02 PM
To: Multiple recipients of list witango-talk
Subject: RE: Witango-Talk: date script
Using the form below, here's the loop(s) for walking through the months
between the years. (see attached for working sample)
<@ASSIGN local$startdate <@ARG matcheddate2>>
<@ASSIGN local$enddate <@ARG matcheddate1>>
<@IF EXPR='<@DATETOSECS DATE="@@local$enddate"> < <@DATETOSECS
DATE="@@local$startdate">'>
<@! COMMENT=" Swap Start/End Date">
<@ASSIGN local$startdate <@ARG matcheddate1>>
<@ASSIGN local$enddate <@ARG matcheddate2>>
</@IF>
local$startdate @@local$startdate <@VAR @@local$startdate FORMAT="">
local$enddate @@local$enddate <BR>
<@FOR START='<@VAR local$startdate format="datetime:%Y">' STOP='<@VAR
local$enddate format="datetime:%Y">'>
<@! COMMENT=" for each year ">
<@ASSIGN local$thisyear <@CURROW>>
local$thisyear: @@local$thisyear<BR>
<@IFEQUAL <@VAR local$startdate format="datetime:%Y"> <@CURROW>>
<@! COMMENT=" Start month from startdate ">
<@ASSIGN local$startmonth <@VAR local$startdate
format="%m">>
<@ELSE>
<@! COMMENT=" Start month is 1 ">
<@ASSIGN local$startmonth 1>
</@IF>
<@IFEQUAL <@VAR local$enddate format="datetime:%Y"> <@CURROW>>
<@! COMMENT=" End month from enddate ">
<@ASSIGN local$endmonth <@VAR local$enddate
format="%m">>
<@ELSE>
<@! COMMENT=" End month is 12 ">
<@ASSIGN local$endmonth 12>
</@IF>
<@FOR START="@@local$startmonth" STOP="@@local$enddate">
<@! COMMENT="for each month in this year">
local$thismonth: <@CURROW><BR>
<@! COMMENT=" calculate the month start/ month ending
here ">
</@FOR>
</@FOR>
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:owner-witango-talk@;witango.com]On Behalf Of John Hollister
Sent: Monday, November 04, 2002 11:03 AM
To: Multiple recipients of list witango-talk
Subject: RE: Witango-Talk: date script
Thanks Anthony
I was just this moring looking over your scripts, I did one that give me
the start and end monthy will even give me an array or the months with
in the rep set month "IF IN THE SAME YEAR between"
Sample of where I am at so far kinda make my wounder why WItango doesn't
have and @month like @days
<pre>
<FORM METHOD="POST" ACTION="<@APPFILE>?_function=list">
<TABLE BORDER=0>
<TR VALIGN=TOP ALIGN=LEFT> <TD>
Matched date:
</TD>
<TD>
<INPUT NAME="matcheddate1" TYPE=TEXT SIZE=10 MAXLENGTH=10
VALUE="">
</TD>
</TR>
<TR VALIGN=TOP ALIGN=LEFT> <TD>
Matched date 1:
</TD>
<TD>
<INPUT NAME="matcheddate2" TYPE=TEXT SIZE=10 MAXLENGTH=10
VALUE="">
</TD>
</TR>
</TABLE>
<INPUT TYPE=SUBMIT VALUE="Find"> <INPUT TYPE=RESET VALUE="Reset Values">
</FORM>
</center>
<@ASSIGN local$getstartdate
<@CALC "(<@ARG matcheddate2 format='datetime:%m'>-<@ARG matcheddate1
format='datetime:%m'>)+1">>
<@ASSIGN local$getstartyear
<@CALC "(<@ARG matcheddate2 format='datetime:%Y'>-<@ARG matcheddate1
format='datetime:%Y'>)">>
<@ARG matcheddate2 format='datetime:%Y'>-<@ARG matcheddate1
format='datetime:%Y'>
<@assign local$monthDays <@array
value='31,28,31,30,31,30,31,31,30,31,30,31;'>>
<@if expr='<@CURRENTDATE format="datetime:%Y">%4=0' true='<@assign
local$monthDays[1,2] 29>'>
<@FOR start=<@ARG matcheddate1 format='datetime:%m'> stop=<@CALC <@ARG
matcheddate2 format='datetime:%m'>+(12*@@local$getstartyear)>>
<@ADDROWS local$getdates "<@CURROW>/01/<@ARG matcheddate1
format='datetime:%Y'>">
<@ADDROWS local$getdates2 "<@CURROW>/<@VAR monthDays[1,<@CURROW>]>/<@ARG
matcheddate1 format='datetime:%Y'>">
</pre>
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:owner-witango-talk@;witango.com] On Behalf Of Anthony M.
Humphreys
Sent: Sunday, November 03, 2002 12:12 PM
To: Multiple recipients of list witango-talk
Subject: Re: Witango-Talk: date script
It looks like you are trying to calculate the first and last day of a
moth
in a given year. Take a look at the attached (commented) TML file for
this
algorithm, and let me know if this helps.
As for the ranges: You already know that there are 12 months in a year,
you
can loop through the year(s), and inside the years loop, you can then
loop
through the month(s) calculating the start/end days of each of the
months.
You can assign the dates you've calculated into to an array. You can use
ADDROWS if you don't know how big the array will be before you start.
Anthony -
[EMAIL PROTECTED]
----- Original Message -----
From: "John Hollister" <[EMAIL PROTECTED]>
To: "Multiple recipients of list witango-talk"
<[EMAIL PROTECTED]>
Sent: Sunday, November 03, 2002 12:48
Subject: Witango-Talk: date script
> I need to get the start end date for each date within a set of dates
>
> From 8/01/2001 to 2/01/2002
> And I need to get this in a new array
>
> 8/01/2001, 8/31/2001;
>
> 9/01/2001, 9/30/2001;
>
> 10/01/2001, 10/31/2001;
>
> 11/01/2001, 11/30/2001;
>
> 12/01/2001, 12/31/2001;
>
> 01/01/2001, 01/31/2001;
>
> 02/01/2001, 02/28/2001;
>
> or a scripts that would help me maybe pre sort the month/Year in a
> stored query?
>
>
>
________________________________________________________________________
> TO UNSUBSCRIBE: send a plain text/US ASCII email to
[EMAIL PROTECTED]
> with unsubscribe witango-talk in the message body
________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
with unsubscribe witango-talk in the message body
________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
with unsubscribe witango-talk in the message body