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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 need 2 join--2tables and find value btwn dates

Author  Topic 

jazzman
Starting Member

2 Posts

Posted - 2008-08-20 : 19:32:06
need some assistance as i am fairly new to sql and what I am trying to accomplish is i have two tables: employee and position joined on position code. I need to find data on the joined to table (position) where its between two dates on this table.
E.g.
Employee Table
EmpID Pos Code Position Effective Date
001 1111 4/9/2007
001 1111 4/9/2007

Position Table
Position Code Effective Date Position Abbr
1111 9/1/2003 Mangr
1111 9/1/2004 Mgr.
1111 9/1/2005 Mgr.
1111 9/1/2006 Mgr
1111 9/1/2007 Mgr
1111 9/1/2008 Mgr

Want to get the position abbreviation in effect at the time the employee was moved into position(position effective date) so in
this case it should pull the title that falls between 9/1/2006 and
9/1/2007. There are multiple rows on employee table for same employee.

Thanks for your help.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-21 : 03:46:49
Are you using sql 2005?
Go to Top of Page

jazzman
Starting Member

2 Posts

Posted - 2008-08-21 : 11:10:20
I'm using 11g on Oracle. Is the syntax different?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-21 : 12:47:13
quote:
Originally posted by jazzman

I'm using 11g on Oracle. Is the syntax different?


Sorry then i must tell you're in wrong forum. This is MS SQL Server forum you need to post your question in some oracle forum to get oracle specific solution.
Go to Top of Page
   

- Advertisement -