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 |
splearner
Starting Member
3 Posts |
Posted - 2011-08-03 : 06:01:48
|
i have following three tables with columnsSTAFF - EMPID, EMPNAME, DEPTIDDEPT - DEPTID, DEPTNAMETRNG - EMPID, COURSE, STARTDATE, ENDDATEplease help me in writing the query to get the result as belowDEPTNAME, EMPNAME, COURSE, STARTDATE, ENDDATEFOR following two conditions1. DEPTID='123' AND EMPNAME='learner' between STARTDATE AND ENDDATE2. DEPTID='123' AND EMPID='1144' BETWEEN STARTDATE AND ENDDATEi appreciate your help.Thanks & RegardsSPLEARNER |
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2011-08-03 : 06:50:15
|
This seems like homework... but this is how you might join your tables. ...From Staff SLeft Join Trng T On S.EmpId = T.EmpIdLeft Join Dept D On S.DeptId = D.DeptId... Give the rest a shot... and post back what you tried if you get stuck.CoreyI Has Returned!! |
|
|
splearner
Starting Member
3 Posts |
Posted - 2011-08-03 : 20:50:23
|
thank you seventhnight..i got it working now with your help |
|
|
|
|
|