
Originally Posted by
June7
If the location is also a factor, use a table the has the periods associated with each state, have fields for lease and purch. Include that table in query that joins to other table with state data. Then the period fields will be available to use in calculation.
[Date of Issue] + IIf(Len(Account)=11, [leaseperiod], [purchperiod])
Otherwise, have fields in the primary table for the period values.
How do I tell it to go to the appropriate state code on each record? Is that something that would just be executed in the query to pull the correct code?
Or do I instead need to put in a macro command to match the state code and then open the query to calculate the date?
Based off of what you sent before, here is the query that I created to define based on length of account number to determine which value will be used:
Code:
[RepoDate]+IIf("len[account]"=11,[LeasePeriod],[RetailPeriod])
does that look right?