Tell me if there is an easier way to do 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?

If there are serial numbers within 5 digits, I need to flag the record.

> You can't use expressions inside hashes on CF5 and less.  That's a
> CFMX-only
> thing.  You can wrap your expressions in a function (int() or evaluate()),
> or assign them to temp variables and use them in your query.  For example:
>
> <cfquery name="checkserialnumber" datasource="test">
> select
> count(*) as MyCount
> from claimdetails where serialnum >= '#prefix##int(suffix - 5)#'
> AND serialnum
> <= '#prefix##int(suffix + 5)#'
> </cfquery>
>
>> -----Original Message-----
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>> Sent: Friday, February 27, 2004 10:46 AM
>> To: CF-Talk
>> Subject: cfmx & cf5
>>
>> I have a query that works fine on MX but shows this error on 5:
>> Invalid parser construct found on line 117 at position 55.
>> ColdFusion was
>> looking at the following text:
>> -
>>
>> Here is my query:
>>
>> <cfquery name="checkserialnumber" datasource="test">
>> select
>> count(*) as MyCount
>> from claimdetails where serialnum >= '#prefix##suffix - 5#'
>> AND serialnum
>> <= '#prefix##suffix + 5#'
>> </cfquery>
>>
>> How do I format for 5 and MX?
>>
>> Thanks!
>>
>>
>>
>>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to