Home » SQL & PL/SQL » SQL & PL/SQL » Problem with join and finding data between 2 dates (11G)
icon7.gif  Problem with join and finding data between 2 dates [message #342238] Thu, 21 August 2008 14:48 Go to next message
Messages: 1
Registered: August 2008
Junior Member
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.
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.
Re: Problem with join and finding data between 2 dates [message #342239 is a reply to message #342238] Thu, 21 August 2008 14:49 Go to previous message
Messages: 25546
Registered: January 2009
Location: SoCal
Senior Member
Please read & follow posting guidelines as stated in URL above
Previous Topic: Need Logic
Next Topic: Each employee with Manager select
Goto Forum:

Current Time: Fri Jul 28 14:45:18 CDT 2017

Total time taken to generate the page: 0.17389 seconds