You need single quotes around "each" of your values in the "IN" clause.

<snip>
AND table_1.table_id IN ('value1','value2','value3')
</snip>

The date formats may be wrong, too.  Check the actual data in the
database and/or use createODBCDateTime() and definitely use
CFQUERYPARAM.  It will make your job a bit eaiser.

Either way, I would remove the dates from your WHERE claus, fix the IN
clause, then run the query.  See if you get any results with very
limited filtering, first.

Then, go from there and add more filtering as needed.

M!ke 

-----Original Message-----
From: Jillian Koskie [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 28, 2005 5:12 PM
To: CF-Talk
Subject: OT - Complex SQL

Okay, I think it's because it is Friday at 4... can somebody help me
out?

SELECT  table_1.expiry_date,
                table_3.expiry_date
FROM            table_3
                JOIN table_2 ON table_2.table2_key = table_3.tablel2_key
                JOIN table_1 ON table_1.table1_key = table_2.table1_key
WHERE   table_1.expiry_date = 'Dec 31, 2005'
                AND table_3.expiry_date = 'Dec 31, 2005'
                AND table_1.table_id IN ('value1,value2,value3')

This isn't returning results, and it should... where is my syntax
incorrect?

--
Jillian

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222625
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to