Z
Zaur Bahramov
Hi!
I have two tables: Categories and Expenses.
Categories table has 3 fields:
CategoryID CategoryName CategoryDescription
1 Stationaries Office materials, pens, paper,
etc.
2 Petrol Petrol for company vehicles
3 Vegetables Expenses related to vegetables
4 Fruits Expenses related to fruits
5 Utilities Gas, electricity, water, etc
Expenses table has 4 fields:
ExpenseID CategoryID ExpenseName AmmountSpent
4 1 Pens$50.00
5 1 Pencils$30.00
6 1 Rulers$75.00
7 1 Glue$20.00
8 2 Diesel for Car A $120.00
9 2 Diesel for Car B $80.00
10 2 Benzine for Car C$70.00
11 2 Benzine for Car D$90.00
12 3 Carrots$40.00
13 3 Pumpkins $20.00
14 3 Cabbage$24.00
15 3 Onions$33.00
16 3 Radish$30.00
17 4 Apples$100.00
18 4 Wine grapes $120.00
19 4 Peaches$70.00
20 4 Bananas$150.00
21 5 September 2009 utility bill $120.00
22 5 October 2009 utility bill $145.00
23 5 November 2009 utility bill $137.00
24 5 Decemper 2009 utility bill $155.00
My task is to make a query that will produce the following result:
Stationaries4 1 Pens $50.00
5 1 Pencils $30.00
6 1 Rulers $75.00
7 1 Glue $20.00
Petrol8 2 Diesel
for Car A $120.00
9 2 Diesel for Car B $80.00
10 2 Benzine for Car C $70.00
11 2 Benzine for Car D $90.00
Vegetables12 3 Carrots $40.00
13 3 Pumpkins $20.00
14 3 Cabbage $24.00
15 3 Onions $33.00
16 3 Radish $30.00
Fruits17 4 Apples $100.00
18 4 Wine grapes $120.00
19 4 Peaches $70.00
20 4 Bananas $150.00
Utilities21 5 September
2009 utility bill $120.00
22 5 October 2009 utility bill $145.00
23 5 November 2009 utility bill $137.00
24 5 Decemper 2009 utility bill $155.00
Is it possible to do so? How?
Thank you!
I have two tables: Categories and Expenses.
Categories table has 3 fields:
CategoryID CategoryName CategoryDescription
1 Stationaries Office materials, pens, paper,
etc.
2 Petrol Petrol for company vehicles
3 Vegetables Expenses related to vegetables
4 Fruits Expenses related to fruits
5 Utilities Gas, electricity, water, etc
Expenses table has 4 fields:
ExpenseID CategoryID ExpenseName AmmountSpent
4 1 Pens$50.00
5 1 Pencils$30.00
6 1 Rulers$75.00
7 1 Glue$20.00
8 2 Diesel for Car A $120.00
9 2 Diesel for Car B $80.00
10 2 Benzine for Car C$70.00
11 2 Benzine for Car D$90.00
12 3 Carrots$40.00
13 3 Pumpkins $20.00
14 3 Cabbage$24.00
15 3 Onions$33.00
16 3 Radish$30.00
17 4 Apples$100.00
18 4 Wine grapes $120.00
19 4 Peaches$70.00
20 4 Bananas$150.00
21 5 September 2009 utility bill $120.00
22 5 October 2009 utility bill $145.00
23 5 November 2009 utility bill $137.00
24 5 Decemper 2009 utility bill $155.00
My task is to make a query that will produce the following result:
Stationaries4 1 Pens $50.00
5 1 Pencils $30.00
6 1 Rulers $75.00
7 1 Glue $20.00
Petrol8 2 Diesel
for Car A $120.00
9 2 Diesel for Car B $80.00
10 2 Benzine for Car C $70.00
11 2 Benzine for Car D $90.00
Vegetables12 3 Carrots $40.00
13 3 Pumpkins $20.00
14 3 Cabbage $24.00
15 3 Onions $33.00
16 3 Radish $30.00
Fruits17 4 Apples $100.00
18 4 Wine grapes $120.00
19 4 Peaches $70.00
20 4 Bananas $150.00
Utilities21 5 September
2009 utility bill $120.00
22 5 October 2009 utility bill $145.00
23 5 November 2009 utility bill $137.00
24 5 Decemper 2009 utility bill $155.00
Is it possible to do so? How?
Thank you!