Submit Your Article Forum Rules

Results 1 to 2 of 2

Thread: ColdFusion Table Data.

  1. #1
    Senior Member
    Join Date
    Aug 2006
    Posts
    406

    ColdFusion Table Data.

    Hello all. I have a bit of a problem and am still searching for an answer on the net and thought this is a good place to ask too...

    I am trying to extract from our sales table information and put it into a table to display (as usual) and am having a difficult time. Below is the code I am using.

    Code:
    <h3>Sales Statistics by Country</h3>
    
    
    <cfparam name="i" default=0>
    <cfquery name="rate" datasource="#request.dsn#">
    	select rate from rate;
    </cfquery>
    
    <cfquery name="sales_can" datasource="#request.dsn#">
    	select sum(total - pst - gst - hst - shipping_price) as total, sale_date, count(sales_id) as num, currency_id from sales where currency_id = 1 and od_archive = 'no' and franchise_id = 0 and wholesale = #request.dbfalse# group by currency_id;
    </cfquery>
    <cfloop query="sales_can">	
    	<cfset Currency = year(currency_id)>
    	<cfset Sales = num>
    	<cfset Totals = total>
    	<cfset Years = sale_date>
    </cfloop>
    
    <table border="0" cellpadding="3" cellspacing="0" width="100%" class="mytable">
    <tr>
    	<th align="center">#</th>
    	<th align="center">Currency</th>
    	<th align="center"># of Sales</th>
    	<th align="center">Dollar Total</th>
    	<th align="center">Years</th>
    </tr>
    
    <cfloop from=1 to=20 index="i">
    <tr bgcolor="#EEF7FF">
    	
    	<td align="center">#i#<cfset i eq (i + 1)></td>
    	<td align="center">#Currency#</td>
    	<td align="center">#Sales#</td>
    	<td align="center">#Totals#</td>
    	<td align="center">#Years#</td>
    
    </tr>
    </cfloop>
    </table>
    Im getting a table that is just displaying for each row the titles of each row, all enclosed between number signs (#). In other words the data is either not being extracted properly from the database or I have written something wrong and it's not displaying right.

    If anyone can take a peek at my code and hopefully see the problem that would be great. I thank everyone for their time.

    Cheers.

  2. #2
    Junior Member
    Join Date
    Dec 2005
    Posts
    14
    Well, for starters, there's no <cfoutput> tag wrapped around anything. So it's not going to evaluate any of your code.

Similar Threads

  1. How do i separate adwords data in Google Analytics from organic data
    By inertia in forum Google Discussion Forum
    Replies: 8
    Last Post: 08-20-2008, 11:10 AM
  2. A new Search engine for table data
    By chrisjon in forum Other Engines/Directories
    Replies: 1
    Last Post: 12-11-2007, 12:15 AM
  3. Table Align to table
    By sysop9999 in forum Graphics & Design Discussion Forum
    Replies: 3
    Last Post: 11-10-2005, 10:00 AM
  4. Graphs from data: PHP or ColdFusion?
    By fernimac in forum Web Programming Discussion Forum
    Replies: 4
    Last Post: 12-02-2004, 07:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •