jwnacnud Posted May 2, 2009 Posted May 2, 2009 (edited) I have the following tables and fields. [Orders] OrderID ShippingTotal TaxTotal [OrdersCharges] ChargeID Amount OrderID Type (can be Tax or Shipping) For EACH order, how can I show the total tax and then the total shipping from the [OrdersCharges] table within the [Orders] table? Each record in the [OrdersCharges] table can have MANY ordercharges. I tried creating a global text field called and TAX and populating it with "TAX". Then I did a self join where Type = Tax. Obviously they matched but this didn't work. Thank you in advance. Edited May 3, 2009 by Guest
bcooney Posted May 3, 2009 Posted May 3, 2009 Why do you have an OrderCharges table if it's a one to one relationship? Just put tax rate, TaxTotal, ShippingTotal in Orders.
jwnacnud Posted May 3, 2009 Author Posted May 3, 2009 Thank you, I have corrected the oversight in my explanation. It is actually a one to many relationship.
comment Posted May 3, 2009 Posted May 3, 2009 There are several ways to approach this, but with only two types perhaps this may suitable: 1. Define an unstored calculation field cTaxType (result is Text) in the Orders table = "Tax". 2. Define a relationship between Orders and a new occurrence of OrderCharges (let's name this TO "TaxCharges") as: Orders::OrderID = TaxCharges::OrderID AND Orders::cTaxType = TaxCharges::Type 3. Define a calculation field cTotalTax (result is Number) in the Orders table = Sum ( TaxCharges::Amount ) Repeat these steps for the Shipping type.
Recommended Posts
This topic is 5742 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now