I have a database table named as d_attendance for recording daily attendance of employees. I have been able to count total no of days present with the help of following query
"select staff_id,name as 'Name', fname as 'Father Name', dept as 'Department', desig as 'Designamtion', count(*) as 'Total Days Present' from d_attendance where dept='" + lblsession.Text + "' and c_date between '" + txtFromDate1.Text + "' and '" + txtToDate.Text + "' and status='Present' group by staff_id,name,fname,dept,desig"
I want to count no. of half days Present also and want to display the result in column 'Total Days Present' logic is Total Days Present= Days Present+ 1/2 * No of half days present.
Please suggest me single SQL server Query.