Hi,
I have a table of PricePlan that looks like
Table PricePlan
ID MerchantID NAME VALIDFROM VALIDUPTO
1. M1 Plan A 1-sep-09 30-sep-09
2. M1 Plan B 7-sep-09 21-sep-09
3. M2 Plan Da 1-sep-09 30-Sep-09
Given a @FromDate and @ToDate I need to find the matching id and Unique MerchantID. Example
@FromDate = '7-sep-09'
@Todate = '9-sep-09'
The return result should be ID 2- M1-Plan B , ID 3-M2-Plan Da
Can anyone help me on the SQL query
thanks in advance - Thomas