473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Sqlserver Query

45
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 Images
File Type: jpg Schedule.jpg (56.9 KB, 61 views)
Sep 3 '10 #1
0 805

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: tango | last post by:
In Excel VBA, I've established an ODBC connection to a SQLServer db, and I can do a successful SELECT query, but I'm having trouble doing an UPDATE query. When I run the following code, I get...
3
by: Devonish | last post by:
I am planning to convert an existing Access database which has a back end (data tables and relationships only) on a server and a copy of the front end (form, queries, reports) on each of about a...
0
by: Alan Z. Scharf | last post by:
1. I have a set of six async calls to SQLServer2000 SP's. 2. These six SP's run fine in SQLServer Query Analyzer when called from a master SP executing the individual SP's in succession. 3....
11
by: kirpi | last post by:
There is an SQLServer database somewhere, and I would like to grab and publish some data to my web pages. I was told: "please, do", and given server address, database name, id, and password. My...
1
by: Poul Petersen | last post by:
SQLserver on Small Business Server for Win 2003. Client application updates records in DB. i.e. the content of a field is updated from "First" to "Second" Client application closed and opend...
5
by: alingsjtu | last post by:
Hello, every body. When execute dynamic generated multiple OPENQUERY statements (which linkes to DB2) in SQLServer, I always got SQL1040N The maximum number of applications is already connected...
1
by: Darsin | last post by:
Hi, I have three tables with there fields given in brackets: User: (PK), Divisions: (PK), DivisionsOfUsers: , the "DivisionsOfUsers" tables has many-to-many relationships between userid...
5
by: bobh | last post by:
Hi All, I have this query which updates a field based on the result of an IIF statement. The table is on SQLServer and I'm linked to it and it has many records and will take Access a very long...
1
by: svskarna | last post by:
i want to retrieve a data everyday 9.00 am .how can i check.for getting date we can use getdate but i want to check ebveryday date with 9.oo am.how can
2
by: Dinesh | last post by:
Hi experts, I am working on SQL Server 2005. Now i have to write a query which will extract some information from a table. My main table is having few columns supose 3 columns. EmpID ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.