Hi,

I am trying to run a query that checks through a list of postcodes, this list comes in 
a comma separated list (eg N12, N13, N15 (these are english postcodes)).  The problem 
is that I want to use a LIKE in my AND clause that checks the postcode.  So my query 
looks like this:

select  PropertyID
        PropertyAddress,
        Town
from    Properties
where   Town = '#attributes.Town#'
AND     Postcode IN ('#replace(attributes.PostCode,",","','",'All')#')

But this leads to some properties being missed out, so I would ideally like to use 
LIKE in my AND clause so it reads:

AND     Postcode LIKE '#attributes.Postcode#%'  

The problem here is how do I deal with the comma separated list of Postcodes.

Any ideas anyone ?

Stephen
______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to