I have two columns of type bit in my sql table, and the values โโin it are similar,
FirstHalfLeave SecondHalfLeave ------------ ------------- 0 1 1 1
I need to sum these two fields to leave it for one day, and I need to output the exact result (3/2=1.5)
I just converted these bit to integer as
sum(CAST(StaffAttendance.FirstHalfStatus as Integer) + CAST(StaffAttendance.SecondHalfStatus as integer))/2 as TotalLeave
it shows the result as 1 not 1.5 , for this I think I need to drop it twice or swim, I donโt know how to do this, can someone help me, thanks in advance
sql-server-2008
shanish
source share