If you don't want to display all the rows your criteria would return, you
can limit one of two ways:

In <cfquery> tag, add:  maxrows="x" to specify maximum number of rows to
return

OR

In <cfoutput add

<cfoutput query="rs_dailytip" maxrows="x">


Either way will do it, but I recommend #1 is best.  No need to return rows
you are going to do nothing with.

Dave

-----Original Message-----
From: John Barrett [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 08, 2008 12:12 AM
To: cf-newbie
Subject: cfquery error

Hi,
I am having a weird issue with a cfquery. The page is located at:
http://www.gotnutrients.net/tips.cfm

It displays the results but then after the results it adds:
Consumer Link
Research Link
(this is at the end of the page)

Is there a way to get it to stop after it runs out of database data?
Basically it gets the latest entry(today),and then goes to the beginning of
the database(Nov.1) in this case.

<cfset today = createOdbcdate(now()) />
<cfset oneWeekAgo = createOdbcdate(dateAdd("d",-7,today)) />

<cfquery name="rs_dailytip" datasource="#REQUEST.dataSource#">
SELECT  *
FROM           daily_tip
where tipdate <= #today#
ORDER BY        tipdate DESC
</cfquery>

<!--- Display table of results--->
<cfset arrColors = ListToArray("##CCFFFF,##FFFFFF")>
<table>
<cfoutput query="rs_dailytip">
<tr>
  <td bgcolor="#arrColors[(currentrow mod 2)+1]#"><b>#DateFormat(tipdate,
"mmmm d, yyyy")#</b><br />#dailytip#</td>
</tr>
<tr>
  <td>Consumer Link<br />#consumer_link#</td>
</tr>
<tr>
  <td>Research Link<br />#research_link#</td>
</tr>
</cfoutput>
</table>

Thanks,
John 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4139
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to