Select upon a date difference between two tables
Posted on 2004-10-25
I have 2 tables:
1. JobId, CompanyId, EntryDate.
Each company can have multiple jobs.
I would like to select all companies whose most recent EntryDate is more than 10 days before its LastLogin Date. (LastLoginDate-EntryDate > 10)
I.e., if a company's LastLoginDate is 12/25/04, and the most recent EntryDate of its jobs is 12/14/04 - it will be selected. If it has a job whose EntryDate is 12/16/04 - it will not be selected.
Can this be done?