To do that kind of thing, I use a cfloop output, and I set the variables 
dynamically for the loop quantity.  By that I mean, I'll divide the total 
recordcount by 2 to get half, and then I'll output on one side from 1 
to the half variable, and then add 1 to the half variable for a new 
startnum var, and then on the right side, output from the startnum (I 
don't define end point on that one, it defaults to the last record).  
You can do this with any number of columns and an unknown total 
qty of records.  The only thing to watch for is if your total 
recordcount falls below what you expect; in that case a statement 
that, should the quantity be below a certain value, it simply outputs 
as a single column, might be in order.  (This might not be the official 
way to do it... just sharing mine.)

Palyne

On 5 May 2001, at 12:34, The Hepburn's wrote:

> I am trying to populate a table from a query but I want record sets 1-20 on
> the left side, results 21-xx next to it and so on.  I thought this would be
> easy but am having a hard time getting it to work.  Code is below.  Any
> ideas?
> 
> <cfif #form.machinegroup# is "">
> <cfquery name="getmachines" datasource="#def_SQLSource#" dbtype="ODBC"
> username="#def_SQLNameHistory#" password="#def_SQLPassHistory#">
> Select MachineName, machinegroup
> >From MachineData
> Order by machineName
> </cfquery>
> <cfelse>
> 
> <cfquery name="getmachines" datasource="#def_SqlSource#" dbtype="ODBC"
> username="#def_SQLNameHistory#" password="#def_SQLPassHistory#">
> Select *
> >From MachineData
> Where machinegroup Like '#form.machinegroup#%'
> </cfquery></cfif>
> 
> 
> <table align="center" bgcolor="#B0D0CF" cellspacing="2" cellpadding="2"
> border="5" frame="box">
> <tr>
> <cfoutput query="getmachinecount">
>     <td>There are currently <font
> color="FF0000"><B>#machinecount#</B></font> Workstations for this SMS
> Machine Group</td></tr></td>
> </tr>
> </table><TABLE border>
> <tr></cfoutput>
> <table>
> <cfoutput query="getmachines" startrow=1 maxrows=5>
> <TR><td width="5" colspan="4" rowspan="4">#Machinename#<br></td><td
> width="5" colspan="4" rowspan="4">#Machinegroup#<br></td></cfoutput>
> <cfoutput query="getmachines" startrow=6 maxrows=10><td
> width="5">#Machinename#<br></td><td
> width="5">#Machinegroup#<br></td></cfoutput>
> </tr>
> 
> 
> 
> 
> -------------------------------------------------------------------------
> This email server is running an evaluation copy of the MailShield anti-
> spam software. Please contact your email administrator if you have any
> questions about this message. MailShield product info: www.mailshield.com
> 
> -----------------------------------------------
> To post, send email to [EMAIL PROTECTED]
> To subscribe / unsubscribe: http://www.dfwcfug.org
> 



-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to