AlterEgo
3/22/2007 7:01:00 PM
Bill,
It appears you have a row where the empno or employeenumber has characters
other than valid numerics. You can try the IsNumeric function, but it
doesn't catch everything. Check BOL.
There must be a reason, but why are you casting both as double?
-- Bill
"Bill Gower" <billgower@charter.net> wrote in message
news:Obm9MLLbHHA.4656@TK2MSFTNGP06.phx.gbl...
> When I run this sql statement I get the above error. If I change the 'not
> in' to an 'in', it works fine. If I run against each table separately it
> works fine. Why can't I cast the nvarchar to a float and use the 'not
> in'? I want to find all the records in the first table not in the second
> table. I have to use the cast.
>
> Bill
>
> Select Distinct EmpNo, FName, LName from DuesSA Where empno <> '' and
>
> cast(EmpNo as double precision) not in (select distinct
> cast(employeenumber as double precision)
>
> from Member
>
> Where EmployerNo = 10 And employeeNumber is not null)
>
>
>
>