473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

sql search and syntax errors in coldfusion search page

22
Hi Peoples

I am using sql to search for whole words in a string "listtext". on the search form my field is named "search" (without the ""'s)
to search for a whole word with a > in front of it I am using
Expand|Select|Wrap|Line Numbers
  1. OR listtext LIKE '%>#form.subject#%' 
this works all ok it seems.

HOWEVER
when i try and serach for a trailing < straight after the word like
Expand|Select|Wrap|Line Numbers
  1. OR listtext LIKE '%#form.subject#<%'
I get a syntax error when it runs

Also as soon as i add that < to the line of code the rest of the line after it changes color to blue indicating that there is something wrong with the code or there is something missing

Can anyone please help with just how i can use the sql to search for a word with a space infront of it and a < straight after it please?
Oct 26 '07 #1
4 2582
MMcCarthy
14,534 Expert Mod 8TB
This SQL statement is querying an Access database and I've been helping the OP out from the Access end.

For the purposes of Access query needs to read

Expand|Select|Wrap|Line Numbers
  1. OR listtext LIKE '%>SomeText%'
and

Expand|Select|Wrap|Line Numbers
  1. OR listtext LIKE '% SomeText<%'
The space after the first wildcard is deliberate in the second statement. Also Access would actually use * as the wildcard but I didn't want to confuse the situation.

Mary
Oct 26 '07 #2
acoder
16,027 Expert Mod 8TB
I get a syntax error when it runs
What's the error message?
Also as soon as i add that < to the line of code the rest of the line after it changes color to blue indicating that there is something wrong with the code or there is something missing
Are you using an editor?
Oct 26 '07 #3
grabit
22
the only error msg i get is that there is a syntax error
and yes im using dreamweaver
Oct 28 '07 #4
acoder
16,027 Expert Mod 8TB
I've not come across this problem before, but it seems as though < is being 'recognised' as the opening character of a tag.

Try constructing your query outside the cfquery tag as a string and then just use that variable within cfquery and see if that solves the problem.
Oct 30 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Zambo via SQLMonster.com | last post by:
Hi! We have Sql Server 2000 in our server (NT 4). Our database have now about +350.000 rows with information of images. Table have lot of columns including information about image name, keywords,...
2
by: T.M. | last post by:
What is the correct syntax for querying the first 20 characters of a memo field? I'm trying to SELECT CAST (varchar(20) fieldname) as newfieldname and i get a bunch of errors Can someone...
2
by: am_pcguy | last post by:
I have a web based application for my company. We use Coldfusion, I wanted to see if I could use Javascript to make the page a bit more dynamic. Right now I use the command: <cfhttp...
0
acoder
by: acoder | last post by:
This page will link to a number of tutorials. Coldfusion Language Coldfusion Variables Using Coldfusion Variables Coldfusion Image Gallery How to upload a file in Coldfusion Watch this...
7
acoder
by: acoder | last post by:
This page will link to a number of tutorials. Coldfusion Language Coldfusion Variables Using Coldfusion Variables Coldfusion Image Gallery How to upload a file in Coldfusion How to send...
11
by: Panlflzs | last post by:
Howdy, I am working on a system where I need a basic HTML form to pass data to a cfm page. The cfm page will then query a database and return any matching data. I am using MySQL. I have my HTML...
3
by: quest007 | last post by:
Hi! I am an ASP.Net programmer. I have been assigned a task to make some modifications to an existing website that is entirely in ColdFusion. However I have no idea about ColdFusion. Is it possible...
1
by: marcnz | last post by:
I have been charged of creating a coldfusion web site for our company. Our database has a ms sql 2005 backend and ms access frontend. Almost all tables are linked tables with the SQL database,...
106
by: bonneylake | last post by:
Hey Everyone, Well i don't know if my question should be in javascript/ajax or coldfusion, i figure this is more of a coldfusion question. But if this is in the wrong section let me know an all...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.