macromedia.coldfusion.advanced_techniques
[Top] [All Lists]

Re: SQL / Coldfusion display question

Subject: Re: SQL / Coldfusion display question
From: "WebDev"
Date: Wed, 12 Sep 2007 15:00:14 -0400
Newsgroups: macromedia.coldfusion.advanced_techniques

Wow, that didn't work at all :-)

I got all the employees listed under all the departments.

<cfquery name="deptDirectory" datasource="sql_abt">
        Select s.firstname, s.lastname, s.ext, s.title, s.email, d.dept
        FROM lsstaff S, lsdepts D
        Where s.deptid = d.deptid
        AND s.rank <> 2 OR s.rank <> 5
        ORDER BY d.dept
        </cfquery>

And then used the suggested CFML to output it....

<cfset deptDirectory = viewState.getValue("deptDirectory")>
<cfoutput query="deptDirectory" group="dept">
     <b>#dept#</b><br>
     <cfoutput>
       <table width="98%" border="0" align="center">
         <tr>
           <td>#firstname#&nbsp;#lastname#</td>
           <td>#title#</td>
           <td>
  <cfif LEN(#ext#) GT 4>
  #ext#
  <cfelse>
       734.827.#ext#
           </cfif></td>
         </tr>
       </table>
     <br></cfoutput>
     <br>
 </cfoutput>

What did I miss? 



<Prev in Thread] Current Thread [Next in Thread>