a syntax error

  • ((@VarEmp_Id=0) or (@VarEmp_Id is null)or (Employee.Emp_Id=@VarEmp_Id)) And

    (Emp_Name=Case @VarEmp_Name is not null Then @VarEmp_Name Else Emp_Name)And

    ((@VarEmp_Surename='') or (@VarEmp_Surename is null)Or freetext(Emp_Surename,@VarEmp_Surename ))And

    i wrote this tsql line , in second line , about Emp_Name,

    something is wrong, and that is a syntax error , that is about

    is not null

    or

    Incorrect syntax near '@VarEmp_Id'.

    would you please help me?

  • This should do:

    (Emp_Name=Case when @VarEmp_Name is not null Then @VarEmp_Name Else Emp_Name end)And

    Hope this helps,

    Gianluca

    -- Gianluca Sartori

  • U missed an 'END' for case in second line.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply