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 |
|
trsisko
Starting Member
2 Posts |
Posted - 2008-09-20 : 19:17:23
|
| I have the following query. I have a problem with this and need help. I am trying to ensure that only the entries with max effdate is shown from the membercontributionrates table. Problem is it doesnt appear to work. Please helpselect *from person mjoin employee a on a.personuid = m.personuidjoin schememember b on a.employeeuid = b.employeeuidjoin memberbenefit c on b.memberuid = c.memberuidjoin benefit d on c.benefituid = d.benefituidjoin membercontributionrates e on a.employeeuid = e.parentuidinner join ( select parentuid, max(Effdate) Effdate from membercontributionrates group by parentuid) addstrippedon e.parentuid = addstripped.parentuidwhere m.nationalIDnumber = ''and e.rate <> .00 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-21 : 01:38:48
|
quote: Originally posted by trsisko I have the following query. I have a problem with this and need help. I am trying to ensure that only the entries with max effdate is shown from the membercontributionrates table. Problem is it doesnt appear to work. Please helpselect *from person mjoin employee a on a.personuid = m.personuidjoin schememember b on a.employeeuid = b.employeeuidjoin memberbenefit c on b.memberuid = c.memberuidjoin benefit d on c.benefituid = d.benefituidjoin membercontributionrates e on a.employeeuid = e.parentuidinner join ( select parentuid, max(Effdate) Effdate from membercontributionrates group by parentuid) addstrippedon e.parentuid = addstripped.parentuidand e.Effdate = addstripped.Effdatewhere m.nationalIDnumber = ''and e.rate <> .00
modify like above |
 |
|
|
|
|
|