select * from Accounts_LeaveEntry where Staff_Id=1012 and To_Date <> datename(dw,To_Date)='Sunday'
Staff_Id To_Date Total_Days Leave_Type Inform_Type 1012 2014-09-07 2 Fullday Not Informed 1012 2014-09-12 1 Fullday Prior 1012 2014-09-14 2 Fullday Not Informed 1012 2014-09-21 2 Fullday Not Informed 1012 2014-09-28 2 Fullday Not Informed
Staff_Id To_Date Total_Days Leave_Type Inform_Type 1012 2014-09-12 1 Fullday Prior
select * from Accounts_LeaveEntry where Staff_Id=1012 and datename(dw,To_Date)<> 'Sunday'
SELECT *, DATENAME(weekday,To_Date) as [DayName] FROM Accounts_LeaveEntry where Staff_Id=1012 DATENAME(weekday, To_Date)<>'Sunday'
select * from #temp6dec where StaffId=1012 and datename(dw,To_Date)!='Sunday'
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)