Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need To Solve This SQL Programming Problem.... 1

Status
Not open for further replies.

bcorll

Programmer
Dec 7, 2005
2
US
In a nutshell, what I want to do is this:
I have a table of projects which a reference to the client for whom the project was done. Basically, I want to extract the names of all clients who have/had a project in the past year but not in the previous five years, and do it with a single SQL statement. I can't think of how to do it. Can anyone else ?
 
something like:
select client from project where project_date between start_date and end_date and client not in (select distinct (client) from project where project date between five_year_start_date and five_year_end_date)

-------------------------
The trouble with doing something right the first time is that nobody appreciates how difficult it was - Steven Wright
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top