so, looking at all the digits, they all have to be within 5 from each other?  regardless of placement?  Why not try to compute the max and min of the numbers. then just check max-min > 5.

Douglas Knudsen (Telecommuting)
ACI RRT Group


"Let your hook be always cast. In the pool where you least expect it, will be fish."
-Ovid

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Fri 2/27/2004 4:17 PM
To: CF-Talk
Cc:
Subject: String within 5 digits....please advise.


Did anyone have an idea of how I would accomplish this:

I have a list of serial numbers (ex. 23T222222222, 23T222222223,
23T452365789). I need to check and see if an of the numbers are within 5
digits of each other. So, I was taking the prefix and suffix:
<cfset Prefix = Left(ListGetAt(form.serialnumber), 3)>
<cfset Suffix = RightListGetAt(form.serialnumber), 9)>
and comparing them to records in the db.

Is there a way to do this without a query? Can I compare using an if
statement?
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to