That was the ticket "or BannerPageID IS Null" - I knew it was something simple that I was forgetting.
I guess to further Clarify - The BannerPageID is so that it can be on a specific page (Like About Us) - or All Pages. And I guess the way that querry is written - All Pages would override that specific page... What happens, is, this is the "First Querry" that gets all the possible banners for a page - then I grab a random banner from that list and display it. But I suppose - if someone is indicating that a Banner is "Only on About Us" they may not want it to rotate with the other banners.... Hurm, I may need to rethink that.... Anyway - Thanks! - Nick -----Original Message----- From: Weidler, Wilfred C. [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 13, 2007 9:04 AM To: CF-Newbie Subject: RE: Querry - with And/Or 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:2545 Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
