Conversion failed when converting the varchar value 'No ' to data type int.

  • See my previous post.

    Unless you can change the left to inner join then this is not a viable solution.

  • Now it's successful... i repalced 'and ' with 'where'

    It worked...

    thanks..

  • Beginner_2008 (8/2/2011)


    Now it's successful... i repalced 'and ' with 'where'

    It worked...

    thanks..

    No it doesn't. What you just did is converted the left join to an inner join. When you put that filter in the where clause it filters out all the nulls... nullifying the left join.

  • Did you try this one?

    Ninja's_RGR'us (8/2/2011)


    left outer join address a with(nolock) on a.parent02aid = CONVERT(VARCHAR(50), m.acctid )

    I still think refactoring is the solution if it matters.

  • No, i tried checking the code and replaced "where"

    Worked out...

    thanks..

  • I'm not sure we have the same definition of worked.

    Either you need the left join or you don't. This filter cannot be moved around without changing the results.

  • what all i need is left outer join ...

    Thanks..

  • Beginner_2008 (8/2/2011)


    what all i need is left outer join ...

    Thanks..

    I'm happy you're happy

    L8rs.

  • Ninja's_RGR'us (8/2/2011)


    left outer join address a with(nolock) on a.parent02aid = CONVERT(VARCHAR(50), m.acctid )

    I still think refactoring is the solution if it matters.

    I would have to disagree Ninja's. This article explains the real root issue.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 9 posts - 16 through 23 (of 23 total)

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