Thanks for the clarification, Jim... I think your point came across more clearly the second time thru. I've never tried the query.column[1] method... I honestly didn't think it would work. Ya learn something new every day, eh?
And you're absolutely right, we can do things with our variables that make other environments seem silly and small! Laterz, J On Sun, 27 Mar 2005 19:00:17 -0500, Jim Davis <[EMAIL PROTECTED]> wrote: > > -----Original Message----- > > From: Jared Rypka-Hauer - CMG, LLC [mailto:[EMAIL PROTECTED] > > Sent: Sunday, March 27, 2005 6:09 PM > > To: CF-Talk > > Subject: Re: Best practice question? > > > > > The odd thing is with queries should you use indexed notation you get a > > > different value. While the value of "queryname.fieldname" is the value > > of > > > the first row the value of "queryname["fieldname"]" is actually a > > reference > > > the column - essentially a one dimensional array containing all of the > > rows > > > values. > > > > Well, yeah, it's true... but it's actually a 2-dimensional array, > > because your column name is the first dimension. I may be being unduly > > picky, but these are issues where "getting it right" is the same as > > "getting it to work." > > I think we're saying the same thing - the QUERY is a two dimensional array, > but the column is a one-dimensional array. > > The result from queryname["fieldname"] is a one-dimensional array, not two. > > > When using query["column"][rowNumber], you're effectively treating > > your entire query as a 2-dimensional array, whereas you're asserting > > that it treats the individual column as a one-dimensional array. It's > > a critical distinction, because query.column[1] should work as you've > > explained it, but it won't. > > It does actually work just as I described (give it a try: query.column[1] > will give you the value from that column for the first row of the query). > > Queryname["fieldname"][index] gives the exact same results as > queryname.fieldname[index]. In this case (accessing a single cell) indexed > and dot notation are equivalent and return the same values. > > However queryname.fieldname returns the value of the first row of that > column while queryname["fieldname"] does not - it returns a one-dimensional > array of all the values in the column. So in this case (accessing a column) > indexed and dot notations result in different values. > > I'm sorry if I said something incorrectly - but the above is definitely what > I meant. > <snippage> -- Continuum Media Group LLC Burnsville, MN 55337 http://www.web-relevant.com http://www.web-relevant.com/blogs/cfobjective ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200171 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

