case
when qa.Wo_nbr is not null and ord.part is not null then 'W'+ qa.wo_nbr else [!]'[/!]0[!]'[/!] end as a
Notice the single quotes around the 0. The first part of the case statement returns a string, but the second returns a number. By putting single quotes around the 0, you are now returning a string that just so happens to be a number. The important point to remember is that all return values from the case statement should have the same data type.
-George
Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.