danmeljeff
Technical User
Using crystal reports XI with an Oracle Database.
I have 3 tables: INVMASTER, CONTRACTLINE, and INVRENTALPRICE
CONTRACTLINE is left outer joined with INVMASTER on the INVIID field. INVRENTALPRICE is left outer joined with INVMASTER on INVIID.
The INVRENTALPRICE table stores the rental rates for products in inventory. Each product can contain one or many prices with an ACTIVE DATE record to denote the active period for the price for that product.
When a contract is written, there is a DATE CREATED record written. This DATE CREATED field is referenced against the ACTIVE DATE on the INVRENTALPRICE table to determine what the charge should be for the product selected.
I am trying to write a report that returns only the correct rental rate for the product selected on the line.
For instance, if a contract is written on 7/1/2008 and a product with sku ABC123 is placed on the contract, the rental rate that populates the contract should be $100. The stored rental rates for product ABC123 are...
4/1/2007 = $225
4/1/2008 = $200
6/8/2008 = $100
2/2/2009 = $75
Currently, for each contract line on my report I am getting 4 price records returned, whereas I only want the record that is the correct rental rate for the period of time as defined by the contract's DATE CREATED vs the products price ACTIVE DATE.
Please let me know if you have any suggestions as to how I can limit my returned records.
Thanks,
Jeff
I have 3 tables: INVMASTER, CONTRACTLINE, and INVRENTALPRICE
CONTRACTLINE is left outer joined with INVMASTER on the INVIID field. INVRENTALPRICE is left outer joined with INVMASTER on INVIID.
The INVRENTALPRICE table stores the rental rates for products in inventory. Each product can contain one or many prices with an ACTIVE DATE record to denote the active period for the price for that product.
When a contract is written, there is a DATE CREATED record written. This DATE CREATED field is referenced against the ACTIVE DATE on the INVRENTALPRICE table to determine what the charge should be for the product selected.
I am trying to write a report that returns only the correct rental rate for the product selected on the line.
For instance, if a contract is written on 7/1/2008 and a product with sku ABC123 is placed on the contract, the rental rate that populates the contract should be $100. The stored rental rates for product ABC123 are...
4/1/2007 = $225
4/1/2008 = $200
6/8/2008 = $100
2/2/2009 = $75
Currently, for each contract line on my report I am getting 4 price records returned, whereas I only want the record that is the correct rental rate for the period of time as defined by the contract's DATE CREATED vs the products price ACTIVE DATE.
Please let me know if you have any suggestions as to how I can limit my returned records.
Thanks,
Jeff