Because your note came with these =, =3d, and =20 characters at the end of each line, it's a little hard to read the code. You say "I am trying to compare a single value "manuId" to a comma delimited list of values which is the field dealersmanufacturers".
Are you saying that the field dealersmanufacturers is stored in the database as a comma-separated list of values, meaning a single record might have a value such as 45,87,23? If so, you may want to reconsider the design to create a table called dealermanufacturers instead, perhaps with just two columns, dealerid and manufacturerid. Then, you would add a join of this table in your query and use the attributes.manuid to compare against this new table. Does that make sense? Or are you for some reason stuck with this poor relational design and have to solve it? There are ways (what DBMS are you using?), but it's not the generally optimal solution. /charlie -----Original Message----- From: webmaster [mailto:[EMAIL PROTECTED]] Sent: Friday, December 21, 2001 11:39 PM To: SQL Subject: HELP!!! This is a multi-part message in MIME format. ------=_NextPart_000_0046_01C18A70.411749A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Is there anyone who can help me figure out this problem? This is what I already have below. Essentially I am trying to compare a = single value "manuId" to a comma delimited list of values which is the = field dealersmanufacturers. Can anyone shed some light on this sql = dilema? Thanks, Branden <cfquery name=3D"dealersMainBody" datasource=3D"#request.maindsn#" = dbtype=3D"#request.dsntype#"> SELECT dealersId, dealersName, dealersLink, dealersDescription, = dealersCategoryId, dealersState, dealersDateCreated, = dealersDateLastModified, dealersOnOff FROM tbldealer WHERE dealersCategoryId =3D #variables.DivisionId# and dealersOnOff =3D = 1=20 <!--- 12/18/01=20 Look for three unique strings, if string is the=20 (1) first in the list (2) last in the list (3) middle of the list ---> <cfif isdefined("attributes.manuid")> and=20 ( dealersmanufacturers like '#left(attributes.manuId,lenam)#,%' or dealersmanufacturers like '%,#right(attributes.manuId,lenam)#' or dealersmanufacturers like '%,#attributes.manuId#,%'=20 ) </cfif> <!--- Bob END ---> ORDER BY dealersName </cfquery> ------=_NextPart_000_0046_01C18A70.411749A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 5.50.4207.2601" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2> <DIV><FONT face=3DArial size=3D2>Is there anyone who can help me figure = out this=20 problem?</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>This is what I already have = below. =20 Essentially I am trying to compare a single value "manuId" to a comma = delimited=20 list of values which is the field dealersmanufacturers. Can anyone = shed=20 some light on this sql dilema?</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Thanks, Branden</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2><cfquery name=3D"dealersMainBody"=20 datasource=3D"#request.maindsn#" = dbtype=3D"#request.dsntype#"><BR>SELECT=20 dealersId, dealersName, dealersLink, dealersDescription, = dealersCategoryId,=20 dealersState, dealersDateCreated, dealersDateLastModified, = dealersOnOff<BR>FROM=20 tbldealer<BR>WHERE dealersCategoryId =3D #variables.DivisionId# and = dealersOnOff =3D=20 1 <BR><!--- 12/18/01 <BR> Look for three = unique=20 strings, if string is the <BR> (1) first in the=20 list<BR> (2) last in the list<BR> (3) middle of = the=20 list<BR>---><BR><cfif = isdefined("attributes.manuid")><BR> and=20 <BR> (<BR> dealersmanufacturers like=20 '#left(attributes.manuId,lenam)#,%'<BR> or<BR> dealersman= ufacturers=20 like=20 '%,#right(attributes.manuId,lenam)#'<BR> or<BR> dealersma= nufacturers=20 like = '%,#attributes.manuId#,%' <BR> )<BR></cfif><BR><!--- = Bob=20 END ---><BR>ORDER BY=20 dealersName<BR></cfquery></FONT></DIV></FONT></DIV></BODY></HTML> ------=_NextPart_000_0046_01C18A70.411749A0-- Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ______________________________________________________________________ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
