Try this code should set you up - Var1 and 2 would obviously be from a query
I would assume? There are a lot of other ways to do this that are cooler but
this should give you the idea and you can work from there.
<CFSET VAR1="BA01/ABC">
<CFSET VAR2="BA01/DEF">
<CFSET FIRSTFOUR="#LEFT(Var1,4)#">
<CFSET NEXTFOUR="#LEFT(Var2,4)#">
<CFOUTPUT>#FIRSTFOUR#, #NEXTFOUR# <CFIF FIRSTFOUR IS NEXTFOUR>YEAH THEY
MATCH</cfif></cfoutput>
-----Original Message-----
From: Michael Gribbin [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 11:13 PM
To: CF-Talk
Subject: Read part of a string
Hi, I need to compare the first 4 characters of a product code "BA01/ABC"
with the first 4 characters of the next product code in sequence "BA01/DEF"
to see if they belong to the same group. How do I "read" only those first 4
characters of each product code?
Thanks in advance,
Michael Gribbin
Digital Marketing Alliance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists