User Profile

Collapse

Profile Sidebar

Collapse
Fahhad
Fahhad
Last Activity: Mar 18 '13, 09:19 AM
Joined: Feb 26 '13
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • How to convert the SQL-C# logic to syntactically-correct SQL code (SQL Server 2005)?

    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...
    See more | Go to post

  • 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...
    See more | Go to post

  • Find 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.
    See more | Go to post

  • How 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...
    See more | Go to post
    Last edited by Rabbit; Mar 1 '13, 04:36 PM. Reason: Please use code tags when posting code.
No activity results to display
Show More
Working...