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 |
mukejee
Starting Member
5 Posts |
Posted - 2014-03-05 : 07:38:14
|
Experts,Need a help urgently.I am having below tablesTable1- StandardID Startdatetime EndDatetime1 10.00AM 11.00AM Table-Attendance Table EmpNo StartDateTime EndDateTime1 10.00AM 11.05AM2 9.45 AM 10.45AM3 10:00 AM 11.00AM4 10:05 AM 11.00AMHere I want to get the Emp No who are there in the time slot of standard table. ie between 10.00AM to 11.AM.Here the total number of emp = 2 ( ID-1,3)Please help me to write this SQLRegardsMukesh |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2014-03-05 : 07:50:21
|
What is the datatype of datetime columns?select attend.empno from attendance as attend inner join standard as stdon attend.Startdatetime <=std.Startdatetime and std.EndDatetime<=attend.EndDatetimeMadhivananFailing to plan is Planning to fail |
|
|
|
|
|