You didn't mention what database you're using... ----- Original Message ----- From: Owens, Howard To: CF-Talk Sent: Thursday, December 12, 2002 7:58 PM Subject: (SQL) Query returning too many rows
I'm stuck on this query: SELECT T1.AD_ID, T1.COMPANY_NAME, T1.CAPTION, T1.AD_NUM, T2.IMAGE_ID, T2.IMAGE_NAME, T2.HEIGHT, T2.WIDTH FROM T1, T2 WHERE T1.DATE_START between #createodbcdate(DateAdd("D", "-7", NOW()))# AND #createodbcdate(now())# AND T1.AD_NUM = T2.AD_NUM Here's the issue ... AD_NUM exists once in T1, but can exist multiple times in T2. Where I should be getting 24 rows returned, I'm getting 55. I'm getting duplicates. And I'm having a brain fart on how to write a query that won't get me duplicates. Some help would be appreciated. Thanks. H. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.