Ideally you'd want those years in a different table so your SQL would be
better but if you can't or don't want to change things:

SELECT *
FROM yourTable
WHERE yourDateColumn LIKE '%#yourDate#%'

Which isn't gonna be fast but it might be exceptable.

Adrian
Building a database of ColdFusion errors at http://cferror.org/

-----Original Message-----
From: Scott Stewart
Sent: 29 October 2008 16:58
To: cf-talk
Subject: odd sql question


i have a table with a field (study_category.category_date) that is a
comma delimited list (2004,2005,2006,2007) stored as a NVARCHAR

I need to see if a passed value is in the list:

 WHERE (#arguments.cat_date# in (study_category.category_date))

arguments.cat_date is a four digit number representing the date.

the where clause doesn't seem to work (returns no records, when
logically it should)
Is this the right approach given the nature of the data?


--
Scott Stewart


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314559
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to