Sorry about possibly botching this question earlier...it still eludes me.
Basically, I have a single table that tracks a group of "approvers" for reports. also tracks when reports are "created" and when they were "submitted."
I am looking to flag when there are date/time overlaps for any reports.
Example (one table, "reports"):
"Created" "Submitted" "ApproverID"
4/20/2012 5:01:32 AM 4/20/2012 5:30:32 AM 10
4/20/2012 5:08:32 AM 4/20/2012 5:45:32 AM 10
4/20/2012 5:01:32 AM 4/19/2012 5:38:16 PM 15
...my need is to return the following (where the same approver overlaps date/time)
"Created" "Submitted" "ApproverID"
4/20/2012 5:01:32 AM 4/20/2012 5:30:32 AM 10
4/20/2012 5:08:32 AM 4/20/2012 5:45:32 AM 10
so the approver (10 in this example) had a window that overlapped these reports. seems like a SELECT with a BETWEEN clause...but I am a bit stumped.
I had something simple like the following:
SELECT Created, LastModified, ApprovalGroupID, count(*)
FROM shifthandover.uniquereports
WHERE ApprovalGroupID between Created and LastModified
Help Appreciated!