Hi everyone,
I've been workin with my database for a while and I'm starting to run into problems with calculating totals and I think it has something to do with the layout of my tables. A rough layout of my tables are;
30 mins later....
Ok, thats a very very rough look at what it looks like, if you still dont quite understand what I have going, then I would be happy to email a picture.
The reason I origionally did my tables like this is, Tables and Chairs I only have 1 type, no variety there, and the relationship to ITEMS.Item, which is a dropdown box that includes; Tables, Chairs, Tents, Combo, Table Cloth, is one to many, and the join type is "Include all records from 'ITEMS' and only thoose from 'PRICE_TABLES' and 'PRICE_CHAIRS' where the joined fields are equal.
ITEMS.Tent Size has 20 x 20, 20 x 30, 20 x 40, etc... for the different sizes of tents. So in PRICE_TENTS.Ten t Size, I have the same values (20 x 20,...) and under PRICE_TENTS.Pri ce I have the price for each size of tent. The situation is similar for ITEMS.Combos, and ITEMS.Table Cloths.
If you followed that I am pretty impressed. My problem comes in when I try to have field that has the "Total" cost for the order. I made an update query where I put in all the math and it updates certian records, but not all. Does anyone have any other ideas of how I can calculate a total cost for an order, or an idea for redesigning the layout of the tables?
Thanks for takin the time to read through this and thanks for any suggestions.
I've been workin with my database for a while and I'm starting to run into problems with calculating totals and I think it has something to do with the layout of my tables. A rough layout of my tables are;
Code:
. /\------------------------\
(ITEMS) | \ (PRICE_TABLES) | (PRICE_CHAIRS)
|Order Number| / \--->|Price | \--->|Price |
|Item |------/
|Tent Size |---------\
|Combo |------\ \ (PRICE_TENTS)
|Table Cloth |------\\ \---------------------------------------------------|Tent Size |
|# of tables | \\ |Price |
|# of Chairs | \\-----------------------------(PRICE_COMBO)
|# of Table Cloths| \ |Combo |
\ |Price |
\ (PRICE_TABLE CLOTH)
\-----|Table Cloth|
|Price |
Ok, thats a very very rough look at what it looks like, if you still dont quite understand what I have going, then I would be happy to email a picture.
The reason I origionally did my tables like this is, Tables and Chairs I only have 1 type, no variety there, and the relationship to ITEMS.Item, which is a dropdown box that includes; Tables, Chairs, Tents, Combo, Table Cloth, is one to many, and the join type is "Include all records from 'ITEMS' and only thoose from 'PRICE_TABLES' and 'PRICE_CHAIRS' where the joined fields are equal.
ITEMS.Tent Size has 20 x 20, 20 x 30, 20 x 40, etc... for the different sizes of tents. So in PRICE_TENTS.Ten t Size, I have the same values (20 x 20,...) and under PRICE_TENTS.Pri ce I have the price for each size of tent. The situation is similar for ITEMS.Combos, and ITEMS.Table Cloths.
If you followed that I am pretty impressed. My problem comes in when I try to have field that has the "Total" cost for the order. I made an update query where I put in all the math and it updates certian records, but not all. Does anyone have any other ideas of how I can calculate a total cost for an order, or an idea for redesigning the layout of the tables?
Thanks for takin the time to read through this and thanks for any suggestions.
Comment