Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jwijaya
Starting Member
1 Post |
Posted - 2012-02-12 : 21:46:42
|
Hi everyone, I really need a help with my simple access database. I am using MS Access and here is my table:Emp_ID M0800 M0830 M0900 M0930 M1000 M1030 M1100 M1130 M1200000001 No____No____No____Yes___Yes___No____No____Yes___Yes000002 No____No____Yes___Yes___Yes___No____Yes___No____Yes000003 No____No____Yes___No____Yes___No____Yes___Yes___No000004 No____No____No____No____Yes___No____No____No____No000005 No____No____Yes___Yes___No____No____Yes___Yes___Yes000006 No____No____Yes___Yes___Yes___No____Yes___Yes___YesM0800: Monday at 08:00AMM1130: Monday at 11:30AMYes: Is where the employee has a scheduled work.No : Free time.Emp_ID: Employee IDIf we look at the table above, we can easily tell that all employees are free from M0800-M0830 and at M1030. But I would like to run a query that simply compare all columns and return the most common free time for everybody ;It will return either just the column name with all "No" value, or it will return the list of all employees with columns that have no "Yes" value like:Emp_ID M0800 M0830 M1030 000001 No____No____No 000002 No____No____No 000003 No____No____No 000004 No____No____No 000005 No____No____No 000006 No____No____NoI do apologize if the table design is so poor due to limited knowledge of database that I have. Please let me know if there is a work around if my query and expected return are impossible to run.Thank you so much in advance!JohnJohn |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|
|