House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

MSSQL Query help - Finding an exact word in a field

  << Previous Post |  RSS |  Tree View |  Sort Oldest First |  Subscribe to this Group Next >> 

MSSQL Query help - Finding an exact word in a field

Chad, we got that to work with some tweaks. It was skipping stuff where CAP Gerald Guido 05/21/2008 03:04 PM
I am full of incomplete thoughts. Chad Gray 05/21/2008 02:30 PM
I re-read my post and I don't make any sense.   I think I was typing Chad Gray 05/21/2008 02:28 PM
In MySQL... '%CAP %' works. Jason Durham 05/21/2008 02:19 PM
I know you can use square brackets and the carrot symbol to exclude characters. Chad Gray 05/21/2008 02:18 PM
Are there a fixed set of delimiters in use in your "title" field?   Gaulin, Mark 05/21/2008 02:16 PM

05/21/2008 03:04 PM
Author: Gerald Guido Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:56485#305841 Chad, we got that to work with some tweaks. It was skipping stuff where CAP as the first word or last word. But yeah that did the trick. Thanx to everyone that helped! You helped save the day. G$ ----- Excess quoted text cut - see Original Post for more -----
05/21/2008 02:30 PM
Author: Chad Gray Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:56485#305840 I am full of incomplete thoughts. I _think_ you can abbreviate with a-z and 1-9 instead of typing out the characters. ----- Excess quoted text cut - see Original Post for more -----
05/21/2008 02:28 PM
Author: Chad Gray Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:56485#305839 I re-read my post and I don't make any sense.   I think I was typing faster than my brain was working.  :) LIKE 'CAP[^T]%' Will not return records with CAPT at the beginning. So LIKE '%[^abcdefghijklmnopqrstuvwxyz]CAP[^abcdefghijklmnopqrstuvwxyz]%' Will return records with CAP or 8CAP9, but won't return records with CAPTAIN or CAPITAL. At least I think it will.  Try it out.  I am not in front of a MS SQL server. ----- Excess quoted text cut - see Original Post for more -----
05/21/2008 02:19 PM
Author: Jason Durham Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:56485#305837 In MySQL... '%CAP %' works. We are trying to tease out the following: SELECT     ProjNum, ClientName, tblProj.Title, StartDate FROM         tblProj WHERE     (tblProj.Title LIKE '%Cost Plan%') OR            (tblProj.Title LIKE '%Cost Allocation Plan%') OR             (tblProj.Title LIKE '%CAP%') The problem is that "OR   (tblProj.Title LIKE '%CAP%')" pulls out everything with CAP in it, like captital, captain etc. (as it should). What we want is to get everything with just the word CAP in it and not word that contains CAP. I know it can be done using Full-Text Search but we don't have it enabled on the DB and installing it is not going to happen any time soon. And this is some what time urgent. Does anyone know how to do that with out enabling Full-Text Search on SQL Server? TIA G "We learn something every day, and lots of times it's that what we learned the day before was wrong." - Bill Vaughan
05/21/2008 02:18 PM
Author: Chad Gray Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:56485#305836 I know you can use square brackets and the carrot symbol to exclude characters. LIKE 'CAP[^T]%' Will give you everything that does not begin with CAPT So I _think_ you can do this.  Try it and let me know. LIKE '%[^abcdefghijklmnopqrstuvwxyz]CAP[^abcdefghijklmnopqrstuvwxyz]%' You are probably going to have to look at the records as you are outputting them and toss out the bad ones so they don't display. Are you sure you cant turn FTS on?  It is sooo much faster than LIKE. ----- Excess quoted text cut - see Original Post for more -----
05/21/2008 02:16 PM
Author: Gaulin, Mark Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:56485#305835 Are there a fixed set of delimiters in use in your "title" field?   If so then you could look for:   (Title = 'CAP'   OR Title like 'CAP %'   OR Title like '% CAP %'   OR Title like '% CAP') We are trying to tease out the following: SELECT     ProjNum, ClientName, tblProj.Title, StartDate FROM         tblProj WHERE     (tblProj.Title LIKE '%Cost Plan%') OR            (tblProj.Title LIKE '%Cost Allocation Plan%') OR             (tblProj.Title LIKE '%CAP%') The problem is that "OR   (tblProj.Title LIKE '%CAP%')" pulls out everything with CAP in it, like captital, captain etc. (as it should). What we want is to get everything with just the word CAP in it and not word that contains CAP. I know it can be done using Full-Text Search but we don't have it enabled on the DB and installing it is not going to happen any time soon. And this is some what time urgent. Does anyone know how to do that with out enabling Full-Text Search on SQL Server? TIA G "We learn something every day, and lots of times it's that what we learned the day before was wrong." - Bill Vaughan
<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference