Nick, You are doing a string comparison to an integer field with the OR BannerPageID = "". If you want the specific BannerPageID I would drop the OR. If it is necessary then if the BannerPageID appears blank, then it is actually NULL. So add OR BannerPageID IS NULL.
________________________________ From: Nick Sweeney [mailto:[EMAIL PROTECTED] Sent: Tue 2/13/2007 8:31 AM To: CF-Newbie Subject: Querry - with And/Or I think the coffee hasn't kicked in yet... I am having trouble with a relatively simple Querry. I am sure it must be a syntxax thing - but I can't figure it out. Essentially - I am making a Banner Rotator, where you can enter in the BannerPage (index.cfm or interior_page.cfm) and PageID. The PageID can be a number to indicate a specific page they want the Banner to show up on - or they can leave it blank to have the Banner show up on all the pages. However, the following querry returns zero results instead of 1. MYSQL database.... <cfquery name="qryGetBanner1" datasource="#datasource#"> SELECT BannerID FROM AdBanner WHERE (Active = 1 AND BannerPlacement = 2 AND BannerPage = "#CurrentPage#") <cfif IsDefined("URL.PageID")> AND (BannerPageID = #PageID# OR BannerPageID = "") </cfif> </cfquery> Thanks! - Nick ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2544 Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
