Hi Pual, Yeah I know that works, but I wanted to use the same cfquery for multi outputs but to change the where clause for different categories. I only have about 7 categories, and so this will not be too bad. I am thinking that maybe I can put all the different quries in a cfc and then invoke it.
Thanks so much for your help`-` John On Aug 20, 2009, at 2:52 PM, Paul Kukiel wrote: > > Hi John, > > Try this: > > <cfquery name="getLinks" datasource="#REQUEST.dataSource#"> > SELECT * > FROM Links > WHERE Category = "CF" > </cfquery> > > <cfoutput query="getLinks" > > <a href="#getLinks.link#">#getLinks.title#</a> <br /> > #description# > </cfoutput> > > Paul > > -----Original Message----- > From: John Barrett [mailto:[email protected]] > Sent: Thursday, August 20, 2009 8:39 PM > To: cf-newbie > Subject: cfquery output+WHERE > > > Can I do something like this? I get an error saying WHERE is not > allowed? > Now I know it is allowed in the cfquery, but if I want to use the > WHERE > clause in the cfquery output are there any options? > > Thanks, > John > > <cfquery name="getLinks" datasource="#REQUEST.dataSource#"> > SELECT * > FROM Links > </cfquery> > > <cfoutput query="getLinks" WHERE Category = "CF"> > <a href="#getLinks.link#">#getLinks.title#</a> <br /> > #description# > </cfoutput> > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4731 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
