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 |
|
sardinka
Posting Yak Master
142 Posts |
Posted - 2005-07-28 : 10:05:32
|
| I have 2 tables:First table: empID,PlanID,groupIDSecond: PlanID,groupID,EffectiveDate,TerminationDate,DeadlineDateI need to show only employee with in spesific group who is not enroll for the current month until deadline passed.Example:empID PlanID groupID1 10 12PlanID GroupID EffectiveDate Terminationdate DeadlineDate10 12 08/01/2005 08/31/2005 08/15/200511 12 09/01/2005 09/31/2005 09/15/20059 12 08/01/2005 08/31/2005 08/15/2005If I run it today I should not get any results back. If I run in on 8/15/2005 I should get back data with palnID11. |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2005-07-28 : 17:14:36
|
| Can you pls clarify? Perhaps some more data would make it clearer. As would a better explanation of how the fields work.Tim |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-07-29 : 01:11:45
|
| is this what you're looking for? just supply the column to be used for criteriaselect f.empid, f.planid fromfirst f join second on f.planid=s.planidwhere [column for date criteria]< getdate()HTH--------------------keeping it simple... |
 |
|
|
|
|
|