MwTV
MIS
- Mar 9, 2007
- 99
Assistance Needed:
Have the following table named "Client";
StartDate----EndDate----ClientID------Name
1/1/07-------3/31/07----246B----------Sheila
4/1/07-------5/31/07----246B----------Sheila
10/1/07-------12/31/07---246B----------Sheila
10/1/07-------12/31/07---258C----------Jane
9/1/07--------12/31/07---278D----------John
Interested in selecting only the records that did not have a StartDate prior to the first day of
the current month, October 1, 2007. In essence, I need only the new clients for the month not clients who might have been a client in the past and are returning.
In this case, my query should only extract the record for Jane. Note, although Sheila, Jane and John are current clients for the month, only Jane is a new client.
So far, I have the following sql script within within Sql Query Analyzer;
Select StartDate, EndDate, ClientID, Name
from Client
where (select ClientID where min(StartDate) >= {d' 10/1/07})
What modifications are needed, if any, to extract the desired result?
Thanks in advance.
Have the following table named "Client";
StartDate----EndDate----ClientID------Name
1/1/07-------3/31/07----246B----------Sheila
4/1/07-------5/31/07----246B----------Sheila
10/1/07-------12/31/07---246B----------Sheila
10/1/07-------12/31/07---258C----------Jane
9/1/07--------12/31/07---278D----------John
Interested in selecting only the records that did not have a StartDate prior to the first day of
the current month, October 1, 2007. In essence, I need only the new clients for the month not clients who might have been a client in the past and are returning.
In this case, my query should only extract the record for Jane. Note, although Sheila, Jane and John are current clients for the month, only Jane is a new client.
So far, I have the following sql script within within Sql Query Analyzer;
Select StartDate, EndDate, ClientID, Name
from Client
where (select ClientID where min(StartDate) >= {d' 10/1/07})
What modifications are needed, if any, to extract the desired result?
Thanks in advance.