I am trying to make a query to prorate rent charges. In order to do this, i need the current charge and the charge directly previuos (BUT there are multiple types of rent and i can't combine different kinds).
I have records that look like this:
tenantID; startDate; endDate; chargeType; Amount
I am trying to do a dlookup where I pass the current record to query variables: e.g.
tenantID1=tenantID (and so on for each needed variable)
What I want to get is the PREVIOUS CHARGE by:
dlookup([Amount], "Charge Schedules", tenantID=tenantID1, chargeType = chargeType1, endDate=startDate1-1)
If the DATE part of it isn't included, the query successfully brings up the CURRENT charge, but the date is CRUCIAL to getting the PREVIOUS charge. When I add the last criterion, the query doesn't work.
PLEASE HELP!!!!! If you can offer a simpler way, I'd be in awe!
I have records that look like this:
tenantID; startDate; endDate; chargeType; Amount
tenantID1=tenantID (and so on for each needed variable)
What I want to get is the PREVIOUS CHARGE by:
dlookup([Amount], "Charge Schedules", tenantID=tenantID1, chargeType = chargeType1, endDate=startDate1-1)
If the DATE part of it isn't included, the query successfully brings up the CURRENT charge, but the date is CRUCIAL to getting the PREVIOUS charge. When I add the last criterion, the query doesn't work.
PLEASE HELP!!!!! If you can offer a simpler way, I'd be in awe!