Microsoft
Software
Hardware
Network
Question : Records In 14 days Date Range
I have three tables Client , Client_Current_Status, Client_All_Statuses
Table Client has next fields:
Client_ID,Client_Name,Clie
nt_Phone
Table Client_Current_Status has next fields:
Status_Id,Client_Id,Status
_Code,Star
t_Date,End
_Date
Client_All_Statuses has next fields:
Status_Id,Status_Code,Star
t_Date,End
_Date
Next data in Client table:
Client_ID is Pk.
Client_ID Client_Name Client_Phone
11111 John Peterson 416-444-3455
22222 Tom Jonson 416-555-5544
33333 Mary Smith 416-321-4567
44444 Raji Junny 416-333-4575
Next data in Client_Current_Status table:
Status_ID is Pk
Status_ID Client_ID Status_Code Date_Start Date_End
123AAA 11111 Open 01/01/2010 Null
124BBB 22222 Closed 01/05/2010 01/20/2010
125CCC 33333 Closed 02/02/2010 03/10/2010
126DDD 44444 Open 03/01/2010 Null
Next data in Client_All_Statuses table:
Status_ID Status_Code Start_Date End_Date
123AAA Closed 10/01/2009 10/05/2009
123AAA Closed 10/10/2009 11/01/2009
123AAA Closed 11/03/2009 12/01/2009
123AAA Open 01/01/2010 Null
124BBB Closed 10/06/2009 11/05/2009
124BBB Closed 01/05/2010 01/20/2010
125CCC Closed 01/10/2010 01/20/2010
125CCC Closed 02/02/2010 03/10/2010
126DDD Open 03/01/2010 Null
I need to pull clients with Status_ID that has Status_Code re-opend in 14 days range.
It means 14 days or less passed between End_Date and next Start_Date for Status_Code.
It means those clients has to have at least 2 entries in Client_All_Statuses table
To be qualified.
44444 has just one and is not counted.
Result has to be something as this.
Client_ID Status_ID Re_Opened_Code<14Days
11111 123AAA Yes
33333 125CCC Yes
I need select statement that will give me this result.
In need to run it against SQL Server2008.
Answer : Records In 14 days Date Range
I am using Access 2003 and it does indeed have an "On Change" event. ??????
Random Solutions
Change default GAL to contacts in exchange 2010 or outlook
Alert from SonicWall Intrusion Prevention IP spoof dropped
Transfer A File using Bluetooth
how can i uninstall powerHA hacmp fileset from unix aix server
Application does not launch
moving sheets within a document
Capture incoming email events for a specific list on Sharepoint site
Sort columns in pivot table.
AJAX, JQUERY, server date timestamp
PHP error