March 9, 2009 at 9:32 am
sELECT CASE WHEN first_Name
Like 'MR.%'THEN
Right(First_Name,Len(First_Name)-4)
ELSE
Right(First_Name,Len(First_Name)-3)
END nn
FROM tblCust
Msg 536, Level 16, State 2, Line 1
Invalid length parameter passed to the RIGHT function.
March 9, 2009 at 9:40 am
Your name must have less then 4 characters? This is why Len returns less then 4, then substract 4, and send to the right function, it says invalid parameter, since it wants a positive number...
Cheers,
J-F
March 9, 2009 at 9:59 am
Can you showe me how to do it please. Thank you
March 9, 2009 at 10:03 am
sELECT CASE WHEN first_Name
Like 'MR.%'THEN
Right(First_Name,Len(First_Name)-4)
ELSE
Right(First_Name,Len(First_Name)-3)
END nn
FROM tblCust
WHERE Len(First_Name) >= 4
Lowell
March 9, 2009 at 11:51 am
Thank you
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply