• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Processing a list with varchar datatype code attached

New Here ,
Jun 19, 2006 Jun 19, 2006

Copy link to clipboard

Copied

A customer created a db with a (Varchar)field that holds a list of number and char example...(123CA65)
She receives about 200 of these numbers that she has to verify that they exist or not in the database. When I input 2 of the numbers of the list (one that I know is in the DB and one that is not) my output returns no record found..However if I just process the one that is in the database it returns 1 record found. I have tried using IN instead of Like is my query but still not success.....Here is my code

<cfform action="Claire.cfm" method="Post"><
<cftextarea name="status" row="38" cols="100" required="yes"></textarea>
<input="submit"></cform>

<cfquery name="Tri" datasource="Corport"> Select Code from Dept where code like '%#Status#%'</cfquery>
<cfset agentlist="#Replace(Status,"#char(13)#","<br>","ALL")#"
<cfif #Tri.recordcount# GT 0><cfoutput>#agentList#</cfoutput>
<cfelse>No records found</cfif>
TOPICS
Advanced techniques

Views

316

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 19, 2006 Jun 19, 2006

Copy link to clipboard

Copied

might be silly Question but did u tried using Upper(Trim(Code)) IN Upper(TRIM('#Status#'))? or one of the combination ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 19, 2006 Jun 19, 2006

Copy link to clipboard

Copied

I'm actually trying to figure out when I put 1 set of numbers in the text area and submit it that it returns a record found but when
I put in more numbers it tells me no records found when I know 1 set of the numbers exist. the input looks like this
12145897,
18PL698-78934CA,
12568pl69

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 19, 2006 Jun 19, 2006

Copy link to clipboard

Copied

LATEST
1. You cannot use LIKE to search on multiple patterns.

2. You have to replace <cr><lf> with "," and use IN

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation