B
BettyG
I'm doing a POS database for a restaurant, and I'm stuck! I really need some
help!!!
I have Table1 with the orders and their costs and Table2 with all the extra
ingredientes for each platter ordered. Table1 and Table2 are related through
a unique code. I'm integrating the information in one query which is the base
for my receipt, but here is where I have the problem, because I would need to
have each extra ingredient for each unique code in Table2 as a column in
Table1, is it possible to do this? Let me put an example to explain myself
better.
Table1
IDOrder PlatterNo. Platter BreadType Category Quantity Cost
UniqueCode
1 1 ManhattanSub Normal Sub 1
$3.5 P1N1
1 2 ScalaSub Normal Sub 1
$3.5 P1N2
1 3 OlivaSub Normal Sub 1
$3.5 P1N3
1 4 DietCoke Drinks
1 $1.5 P1N4
2 1 ManhattanSub Normal Sub 1
$3.5 P2N1
2 2 RegularCoke Drinks
1 $1.5 P2N2
3 1 ScalaSub Normal Sub 1
$3.5 P3N1
3 1 DietCoke Drinks
1 $1.5 P3N2
And so on...
Table2
UniqueCode ExtraIngredient Cost
P1N1 ExtraCheese $1.0
P1N1 ExtraHam $0.5
P3N1 ExtraCheese $1.0
If I integrate this information in a single query, it duplicates te
information and eliminates the orders that don't have extra ingredients, this
way
Query
IDOrder PlatterNo. Platter BreadType Quant. Cost
UniqueCode ExtraIngredient Cost
1 1 ManhattanSub Normal 1 $3.5
P1N1 ExtraCheese $1.0
1 1 ManhattanSub Normal 1 $3.5
P1N1 ExtraHam $0.5
3 1 ScalaSub Normal 1 $3.5
P3N1 ExtraMeat $1.5
What I'm lookin for is to have the following results:
IDOrder PlatterNo. Platter Quant. Cost Code ExtraIngr.1
Cost ExtraIngr.2 Cost
1 1 ManhattanSub 1 $3.5 P1N1 ExtraCheese
$1.0 ExtraHam $0.5
1 2 ScalaSub 1 $3.5 P1N2
1 3 OlivaSub 1 $3.5 P1N3
1 4 DietCoke 1 $1.5 P1N4
2 1 ManhattanSub 1 $3.5 P2N1
2 2 RegularCoke 1 $1.5 P2N2
3 1 ScalaSub 1 $3.5 P3N1
ExtraMeat $1.5
3 1 DietCoke 1 $1.5 P3N2
Is it possible to obtain the results I'm looking for?
help!!!
I have Table1 with the orders and their costs and Table2 with all the extra
ingredientes for each platter ordered. Table1 and Table2 are related through
a unique code. I'm integrating the information in one query which is the base
for my receipt, but here is where I have the problem, because I would need to
have each extra ingredient for each unique code in Table2 as a column in
Table1, is it possible to do this? Let me put an example to explain myself
better.
Table1
IDOrder PlatterNo. Platter BreadType Category Quantity Cost
UniqueCode
1 1 ManhattanSub Normal Sub 1
$3.5 P1N1
1 2 ScalaSub Normal Sub 1
$3.5 P1N2
1 3 OlivaSub Normal Sub 1
$3.5 P1N3
1 4 DietCoke Drinks
1 $1.5 P1N4
2 1 ManhattanSub Normal Sub 1
$3.5 P2N1
2 2 RegularCoke Drinks
1 $1.5 P2N2
3 1 ScalaSub Normal Sub 1
$3.5 P3N1
3 1 DietCoke Drinks
1 $1.5 P3N2
And so on...
Table2
UniqueCode ExtraIngredient Cost
P1N1 ExtraCheese $1.0
P1N1 ExtraHam $0.5
P3N1 ExtraCheese $1.0
If I integrate this information in a single query, it duplicates te
information and eliminates the orders that don't have extra ingredients, this
way
Query
IDOrder PlatterNo. Platter BreadType Quant. Cost
UniqueCode ExtraIngredient Cost
1 1 ManhattanSub Normal 1 $3.5
P1N1 ExtraCheese $1.0
1 1 ManhattanSub Normal 1 $3.5
P1N1 ExtraHam $0.5
3 1 ScalaSub Normal 1 $3.5
P3N1 ExtraMeat $1.5
What I'm lookin for is to have the following results:
IDOrder PlatterNo. Platter Quant. Cost Code ExtraIngr.1
Cost ExtraIngr.2 Cost
1 1 ManhattanSub 1 $3.5 P1N1 ExtraCheese
$1.0 ExtraHam $0.5
1 2 ScalaSub 1 $3.5 P1N2
1 3 OlivaSub 1 $3.5 P1N3
1 4 DietCoke 1 $1.5 P1N4
2 1 ManhattanSub 1 $3.5 P2N1
2 2 RegularCoke 1 $1.5 P2N2
3 1 ScalaSub 1 $3.5 P3N1
ExtraMeat $1.5
3 1 DietCoke 1 $1.5 P3N2
Is it possible to obtain the results I'm looking for?