maybe - here is some code - untested - try it:
<cfquery name="qMonth" datasource="dsnhere">
select * data for the month
we'll say the fields are itemId, itemTime, itemDesc, itemTitle, itemDate
</cfquery>
<cfscript>
// a date in month you want to pull
theDate = createdatetime(2003, 02, 01, 0, 0, 01);
// holds our data
m = structNew();
// holds the days
m.d = arrayNew(1);
for(i = 1; i < daysInMonth(theDate); i++){
// adding items struct which will hold an items array
m.d[i] = structNew();
m.d[i].i = arrayNew(2);
}
function addItem(day, itemId, itemTime, itemDesc, itemTitle){
i = arrayLen(m.d[day].i);
m.d[day].i[i][1] = itemId;
m.d[day].i[i][2] = itemTime;
m.d[day].i[i][3] = itemDesc;
m.d[day].i[i][4] = itemTitle;
}
</cfscript>
<cfloop query="qMonth">
<cfscript>addItem(day(itemDate), qMonth.itemId, qMonth.itemTime,
qMonth.itemDesc, qMonth.itemTitle)</cfscript>
</cfloop>
<!--- loop it like : --->
<cfloop from="1" to="#arrayLen(m.d)#" index="i">
<!--- each day is looping --->
<cfoutput>Day #i#</cfoutput>
<cfloop from="1" to="#arrayLen(m.d[i].i)#" index="ii">
<!--- each item for the day --->
<cfoutput>
#m.d[i].i[ii][1]# -
#m.d[i].i[ii][2]# -
#m.d[i].i[ii][3]# -
#m.d[i].i[ii][4]#
</cfoutput>
</cfloop>
</cfloop>
Nate Nielsen
[EMAIL PROTECTED]
[EMAIL PROTECTED]
----- Original Message -----
From: "Mark Lansdon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 04, 2003 5:34 PM
Subject: Re: CFMX vf CF Structures
> "kinda sorta" along those lines:
> I have a calendar that I am doing a loop within each day to query each
> days events for that calendar month.
> I've wondered if: an array or structure (hyperlink title and event id)
> would
> run faster?? thought i would ask the group
> Right now my execution time for a 30 day month is 350ms
> * running CFMX professional on a win2k box
> ** as a sidebar i installed the MX updater package which is essential
> all the macromedia patches
>
>
> >>> [EMAIL PROTECTED] 02/04/03 04:22PM >>>
> Looks like CFMX handles structures differently than CF. There are 2
> different ways to set a structure's key:
>
> <cfset stTest = StructNew()>
> <cfset stTest.Key1 = "">
> <cfset stTest["Key2"] = "">
>
> In CF5 and earlier versions, the key would be returned as Upper Case
> text, regardless of which approach you used to set the structure's
> keys.
> In MX, however, the key is returned in whatever case you use for the
> key
> name when using the second approach above. This is important if you
> use
> XSL stylesheets to render data sourced from a structure. I spent the
> better part of a day trying to figure out why my stylesheets are not
> rendering in MX. Hope this saves you some time.
>
>
> Thanks -
>
> Tom Schreck
> 817-252-4900
> [EMAIL PROTECTED]
>
> I have not failed. I've found 10,000 ways that won't work.
>
> - Thomas Edison
>
>
> -----------------------------------------------
> To post, send email to [EMAIL PROTECTED]
> To unsubscribe:
> Send UNSUBSCRIBE to [EMAIL PROTECTED]
> To subscribe / unsubscribe: http://www.dfwcfug.org
>
-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To unsubscribe:
Send UNSUBSCRIBE to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org