John,

It looks to me that it is data related.  Have you looked at the data in your
table to see if you have a record with an empty column value for
consumer_link and research_link ?  Your loop will only through for the
number of records you get back in your result set.  

Try putting this above your <cfoutput query-"rs_dailytip">:

<cfdump var="#rs_dailytip#">

This will dump the contents of the query to the screen and you can then see
what your loop is going through. If you have a row of data without values in
consumer_link and research_link, then this is what is causing your issue.
You could then add the following to your query:

AND (tipdate is not null   or consumer_link is not null or research_link is
not null)

Dave

-----Original Message-----
From: John Barrett [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 14, 2008 1:13 AM
To: cf-newbie
Subject: Re: cfquery error

Hi Rick,
Thanks again for your help:)
I was trying to figure out why if I do not have the AND tipdate
>='2008-11-01' in the where clause why I get one extra Consumer Link
 
Research Link 

at the end. Here is a link to the page:
http://www.gotnutrients.net/test_tips.cfm

the one with the AND is on the main site
http://www.gotnutrients.net/tips.cfm which is working just the way it
should.

My next task is to write a cf project to update and change the database,
which I am starting tonight.
Thanks so much,
John



<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# AND tipdate >='2008-11-01'
order by tipdate desc
limit 21
</cfquery>

<!--- output--->
<table>
<cfoutput query="rs_dailytip">
<tr>
  <td><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>


      



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:4156
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