I have two tables. Table 1 contains plan code and a target date. In the other table (Table 2), I have plan code and a series of dates for each plan code. I would like to create a query that finds the date from Table 2 that is the greatest of those less than the date in Table 1.
For example:
Table 1
PlanCode Date
123456 1/1/1995
Table 2
PlanCode Date
123456 1/1/1900
123456 5/7/1971
123456 11/3/1990
123456 1/11/1998
123456 2/5/2004
My desired result would be to get 11/3/1990 associated with the plan code in Table 1. It seems like an easy thing to do, but I am stumped. Thanks for any help.
Seti
For example:
Table 1
PlanCode Date
123456 1/1/1995
Table 2
PlanCode Date
123456 1/1/1900
123456 5/7/1971
123456 11/3/1990
123456 1/11/1998
123456 2/5/2004
My desired result would be to get 11/3/1990 associated with the plan code in Table 1. It seems like an easy thing to do, but I am stumped. Thanks for any help.
Seti