txtTotal.Text = getTotal("Select (sum(total_netpay),0) from emp_payroll where week(PDate) =week(now())").ToString("#,##0.00");
Incorrect syntax near ','.'
txtTotal.Text = getTotal("Select ifnull(sum(total_netpay),0) from emp_payroll where week(PDate) =week(now())").ToString("#,##0.00");
COALESCE
ISNULL
txtTotal.Text = getTotal("Select ISNULL(sum(total_netpay),0) from emp_payroll where PDate is not null AND DATENAME(week, PDate) = DATENAME(week, getdate()) AND year(getdate()) = year(PDate)").ToString("#,##0.00");
total_netpay
IFNULL
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)