Hey guys,
I am trying to write a query that will show me anyone who has a gap or missing time period in their payment date records.
For example, a normal record would look like this:
SSN Payment Date
113335656 2006-12-01
113335656 2007-01-01
I want to find people who might be missing a year or month such as this:
SSN Payment Date
113435656 2006-12-01
113435656 2009-12-01
The closet I've come up with is finding people who don't have all 12 months, but since some people may start work in the middle of the year, they shouldn't be in my query results. If I can at least find people who have gaps in the years, that would be a good start.
If possible, I want to find a way with derived tables. I don't have WRITE access to the database so I don't believe I can use CREATE TABLE or CREATE VIEWS to hold date values.
Can anyone help me? Thanks
I am trying to write a query that will show me anyone who has a gap or missing time period in their payment date records.
For example, a normal record would look like this:
SSN Payment Date
113335656 2006-12-01
113335656 2007-01-01
I want to find people who might be missing a year or month such as this:
SSN Payment Date
113435656 2006-12-01
113435656 2009-12-01
The closet I've come up with is finding people who don't have all 12 months, but since some people may start work in the middle of the year, they shouldn't be in my query results. If I can at least find people who have gaps in the years, that would be a good start.
If possible, I want to find a way with derived tables. I don't have WRITE access to the database so I don't believe I can use CREATE TABLE or CREATE VIEWS to hold date values.
Can anyone help me? Thanks