Sqlserver Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NareshN
    New Member
    • Aug 2010
    • 45

    Sqlserver Query

    Hi,

    I have this Table based on this i need to display reports.

    TID EmpNo Date TimeIn TimeOut StartTime
    1 100 8/1/2010 17:00 2:00 17:00
    2 100 8/2/2010 17:00 2:00 17:00
    3 100 8/2/2010 Off Off Off
    .... so on upto 4 weeks similarly for all the employees.

    I need to display reports for Consistency Week off among the employees.

    If there are 100 Employees then 50 employees may get week off on the same day(say sunday).20 Employees may get on saturady.30 may be on friday.

    I need to find percentage of employee who are getting consistency week off(week off on the same day).

    Help me in writing the query in sqlserver to get reports like that in front End.Reports should for last 4,3 2weeks

    Matching Days Off Across 4 weeks 3 weeks 2 weeks
    1 98% 100% 100%
    2 0% 0% 0%

    Here 1 means 1 day macthing in week off.98% of the employees are getting week off in the sameday in last 4 weeks,
    2 means 2 days matching week off(Say saturday and Sunday).

    Please find the attached image.Please see last grid of the image i want result like that.
    Attached Files
Working...