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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No Activity 1

Status
Not open for further replies.

xxing

Programmer
Feb 17, 2004
61
NZ
Hi

I have a period table as follows:

StartDate EndDate
1 Jan 2008 31 Jan 2008
1 Feb 2008 29 Feb 2008
1 Mar 2008 31 Mar 2008
1 Apr 2008 30 Apr 2008

I have a customer table as follows:

ID Name Date
1 Blogg 15 Jan 2008
2 Smith 20 Mar 2008

I want to see the following:

ID Name Start Date EndDate
1 Blogg 1 Feb 2008 29 Feb 2008
1 Blogg 1 Mar 2008 31 Mar 2008
1 Blogg 1 Apr 2008 30 Apr 2008
2 Smith 1 Jan 2008 31 Jan 2008
2 Smith 1 Feb 2008 29 Feb 2008
2 Smith 1 Apr 2008 30 Apr 2008

I want to see the periods of no activity for a client

Thank you for your help

Regards
Mark
 
Hi,

This should work...

Code:
select cl.id, cl.name, cy.*
from [Client] cl
join [Cycle] cy on not cl.date between cy.Startdate and cy.Enddate


Ryan
 
Thank you RyanEk for your email. A star for you!!

Regards
Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top