Hi,
I'm wondering if this is possible. I have three Tables.
tblTransactions
Patient Procedure Procedure Date Provider
XYZ 99 5/1/2003 1
XYZ 99 5/1/2004 1
XYZ 99 5/1/2005 1
tblProcedures
Procedure Code Amount Start Date End Date
99 75 1/1/2003 12/31/2003
99 80 1/1/2004 12/31/2004
99 78 1/1/2005 12/31/2005
tblProviders
Provider Contract Start Contract End
1 11/1/2002 10/31/2003
1 11/1/2003 10/31/2004
1 11/1/2004 10/31/2005
The procedure codes are in use from there start date to there end date, however, if a provider signs their contract during the year (not on the calendar year), they use that years numbers for their contract year. For example, the transaction on 5/1/2004 should have an amount of 75.00. The transaction on 5/1/2005 should have an amount of 80.
I've tried to come up with a subquery to pull this, but I don't know how to do it with the two variables (Provider contract dates and procedure dates)
Any hints?
Todd
I'm wondering if this is possible. I have three Tables.
tblTransactions
Patient Procedure Procedure Date Provider
XYZ 99 5/1/2003 1
XYZ 99 5/1/2004 1
XYZ 99 5/1/2005 1
tblProcedures
Procedure Code Amount Start Date End Date
99 75 1/1/2003 12/31/2003
99 80 1/1/2004 12/31/2004
99 78 1/1/2005 12/31/2005
tblProviders
Provider Contract Start Contract End
1 11/1/2002 10/31/2003
1 11/1/2003 10/31/2004
1 11/1/2004 10/31/2005
The procedure codes are in use from there start date to there end date, however, if a provider signs their contract during the year (not on the calendar year), they use that years numbers for their contract year. For example, the transaction on 5/1/2004 should have an amount of 75.00. The transaction on 5/1/2005 should have an amount of 80.
I've tried to come up with a subquery to pull this, but I don't know how to do it with the two variables (Provider contract dates and procedure dates)
Any hints?
Todd