I have a table of the data appended every year based on the effective dates. of the changes. The data changes once a year at 10/1 and is assigned a new version number. The relevant fields in this table are Code, Version, Effective Date, Amount.
The second table is a list of customers who come in and have a service performed and are charged a fee based on the current rate in the first table.
I want to match up the correct fee from the first table based on the date of service and the code charged.
What is the syntax to obtain the correct amount where the Code service date is between the beginning and ending effective date of the correct version the first table?