Click here to Skip to main content
15,795,712 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
Respected Sir,

I have a gridview control and in database table there is a field named attandence1,attandance2 and in this table`s field the value is 0,1,2 where 0 represents absent and 1 represents present and 2 represents onleave,Now i want to display absent for 0 in grdiview control and so on.

How it is possible.
Pls help me out.

1 solution

Try this.
select CASE WHEN attandence1 = 0  THEN 'Absent' 
            WHEN attandence1 = 1  THEN 'Present' 
            ELSE 'OnLeave' END AS attandence1 from tablename
Share this answer
abhiamity86 11-Aug-11 6:08am    
thanks for reply
but it giving error incorrect syntax near','.
Toniyo Jackson 11-Aug-11 6:09am    
Post your sql query here

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900