SQL Server - What is the mistake in here i tried many times but i can't find answer

Asked By Mano on 26-Jul-10 07:28 AM
this is a table i have created it has some values but when i try to retrieve values by using this

 "      select right(Eventid,4) from cat      " but its not working instead it shows blank values in the column

create table Cat
(
    EventID char (20) primary key,
    evendes varchar(50) null
)





Jaya Nehru Kumar replied to Mano on 26-Jul-10 07:38 AM
because of empty spaces it doesn't show the value
try the following , it will trim the empty spaces if any
 select right(rtrim(ltrim(Eventid)),4) from cat