I am assuming that the undefined building means not seated?

Now here is the trick your missing

Make sure you're query is sorted by building and then what ever something
like

order by Building,fName in your query.

Then insteado of using cfloop, use cfoutput like this

<cfoutput query="queryName" group="building">
 <cfif queryName.Building neq "">
 Building: #queryName.Building#
 <cfoutput>
 #fName# #lName#
 </cfoutput>
 <br>
 </cfif>
</cfoutput>

Now I am not sure how the undefined string will be sorted with this, but you
could run this twice one with is numeric around the output and one if its
null...

And why do people insist on learning CF with this?
  <cfif #distinctBuilding.building# NEQ "">

instead of
  <cfif distinctBuilding.building neq "">

Who is teaching you that?



On 5/23/07, Christopher Chin <[EMAIL PROTECTED]> wrote:
>
> I have this cfloop issue that is driving me bananas...I'm trying to create
> a tree menu for one of my apps.
>
> Supposed to look like this:
>
> Building: XXXXX
> (list of employees seated in this building)
>
> Not seated:
> (employees not seated anywhere)
>
> Since there's going to be a varying amount of buildings I select all the
> employees from a search criteria, and then do a query of a query to get the
> distince buildings within this search result.  MY ISSUE: I'm missing data
> for building 1500.  Seems as if the 2nd iteration through the outer loop
> isn't advancing the currentRow.  Hopefully someone can see where I'm going
> wrong here.
>
> See CFDUMP of my queries here:
> http://www.christopherchin.com/empresult.jpg
> First dump is the actual query results.  Second dump is a query of a query
> to get the distinct building numbers.
>
> This is my output:
> =================
> Building: 160
> Brian Malone
>
> Building: 1500
> Brian Malone
>
> Not Mapped:
> Alison Greenberg
> Amrita Sohal
> Ashley Brochstein
> Chris McBain
> David Djanikian
> Eric Toner
> John Quevedo
> Katie Tarulli
> Martha Ohara
> Matthew Elkins
> Maureen Haskell
>
> Here's my code:
> <cfloop query="distinctBuilding" startrow="1"
> endrow="#distinctBuilding.recordCount#">
>        <cfif #distinctBuilding.building# NEQ "">
>        Building: #distinctBuilding.building#<br />
>        <cfloop query="empResult">
>                <cfif #trim(empResult.building)# EQ #trim(
> distinctBuilding.building)#>
>                        #empResult.fname# #empResult.lname#<br />
>                </cfif>
>        </cfloop>
>        <cfelse>
>        Not Mapped:<br />
>        <cfloop query="empResult">
>                <cfif #empResult.building# EQ "">
>                #empResult.fname# #empResult.lname#<br />
>                </cfif>
>        </cfloop>
>        </cfif>
> <br />
> </cfloop>
>
> Thanx!
> Chris
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278920
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to