ok, it appears to be my order by clause. having simply ORDER BY article_id DESC works? if anyone can expand on this for me it would be appreciated as i really would like to order as i have in the query that does not work...
>I know this is gunna be something simple... > >I have a cfc which contains the following query (using access database)... > ><cfquery name="qgetArticles" datasource="#variables.dsn#" >username="#variables.dbusername#" password="#variables.dbpassword#"> > >SELECT <cfif arguments.recent>TOP 1</cfif> >article.* >FROM article >WHERE 1=1 ><cfif isDefined("arguments.article_id")> > AND article_id = <cfqueryparam value="#arguments.article_id#" >cfsqltype="cf_sql_integer"> ></cfif> ><cfif isDefined("arguments.issue_id")> > AND issue_id = <cfqueryparam value="#arguments.issue_id#" >cfsqltype="cf_sql_integer"> ></cfif> >ORDER BY issue_id DESC, order_key ></cfquery> > >The query executes perfectly except that is returns 3 rows instead of one. >In the debugging out it shows... > >qgetArticles (Datasource=GME14211S1A, Time=16ms, Records=3) in >C:\CFusionMX\wwwroot\Interface\com\article.cfc @ 10:44:00.000 > >SELECT TOP 1 >article.* >FROM article >WHERE 1=1 >ORDER BY issue_id DESC, order_key > >What am I doing wrong, as the TOP function is working fine in another query. > >Regards >Mike ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion MX7 and Flex 2 Build sales & marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:283432 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4