How to convert the following SQL-C# logic to syntactically-correct SQL code (SQL Server 2005)?
"Descriptio n", "LeaveType" , "MonthlyMaxLeav e", "YearlyMaxLeave " are the column names in the table EmpTab.
I have written a basic logic to calculate the PayLeave and NonPayLeave, and to display its final values. Assume that the fields "Descriptio n" and "LeaveType" always...
User Profile
Collapse
-
Fahhad started a topic How to convert the SQL-C# logic to syntactically-correct SQL code (SQL Server 2005)?in SQL ServerHow to convert the SQL-C# logic to syntactically-correct SQL code (SQL Server 2005)?
-
Why is the "EndDate" not getting executed in my SQL Function (UDF)?
I need to pass the @startDate and @endDate as variables to @range in the code given below. But when I execute the below code, I'm getting the Error as follows. What is going wrong in my code, and how can I correct it?
Errors:
Msg 102, Level 15, State 1, Procedure GetWorkingDays2 , Line 4
Incorrect syntax near ')'.
Msg 178, Level 15, State 1, Procedure GetWorkingDays2 , Line 19
A RETURN statement with... -
Fahhad started a topic Find the first Day (01) and the Last Day (28) for a specified month in SQL Function?in SQL ServerFind the first Day (01) and the Last Day (28) for a specified month in SQL Function?
I need to write an SQL Function (UDF) to find the First Day (int) and the Last Day (int) when I specify a date.
For example: When I specify (20130217) (i.e. Feb 17th, 2013), I should be able to find the First Day (01) and the Last Day (28) for the specified month (in this case, Feb).
How can I do that? Please provide the necessary code to implement this feature in my SQL Function.
Thanks. -
Fahhad started a topic How to find working days for an employee in a specific Month & Year (Eg: Aug, 2012)?in SQL ServerHow to find working days for an employee in a specific Month & Year (Eg: Aug, 2012)?
I have created a database with two fields "EmpID" (int) and "LeaveDate (DateTime) using SQL Server 2005.
How Do I modify the below Stored Procedure to find the total working days for an employee in a specified Month and Year(Eg: August, 2012)?
The Total Working Days is as follows;
Total Working Days = (Total days in a month) - ( (Weekends: Sat and Sun) + (Number of days' Leave taken by the...
No activity results to display
Show More