----------------------------------------------------------- New Message on BDOTNET
----------------------------------------------------------- From: rapshod Message 12 in Discussion this solution is based on the assumption that there cannot be an entry in the table with startdate null and valid end date..ie there cannot be an entry with code=N without a corresponding code=R The following query will generate the result set you desire Select a.id, a.dates AS startdate,b.dates as enddate,a.code,b.code from (select * from table-A where code='R') a left join (select * from table-B where code='N') b on a.id=b.id ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/BDOTNET/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
