>I'm a little baffled with this one.
>
>I'm sending the following through SPT to SQL Server:
>
>SELECT MAX(RIGHT(RTRIM(CustAddrID), 5)) AS CustAddrID
>FROM tarCustAddr
>WHERE (CustKey = 114) AND (LEFT(CustAddrID, 4) = 'ADR_') AND (isnumeric(RIGHT(RTRIM(CustAddrID), 5)) = 1)
>
>
>When I execute it in Enterprise Mgr, I get back a record containing the value 00001 - but when I execute it through SPT, I get a single NULL record in the resulting cursor! I've traced it through SQL Profiler to make sure the command is sent through untouched and it is indeed sent to SQL server exactly as I defined.
>
>The CustAddrID is a char field.
>
>Any idea how I might be tripping myself up?
>
Just a WAG - are you hitting the same database?