>>Change where clause to
>>
>>where RTRIM(LTRIM(Item.ticket)) = RTRIM(LTRIM(temp))
>
>
>OR AllTrim()
MS KB article Q142887 states that "Using an ALLTRIM() function with an SELECT-SQL statement when SET ANSI OFF may result in the return of an incorrect subset of records."
--sb--