Question
Building a complex cfquery
Hello community. I'm building an application and I'm getting
a bit lost when building the logic for a report:
This is for a construction company. Everyday the enter the information of what was done that day and how much money in material, rental and labour they spent. At the same time, this is entered by category and subcategory. So let's say my 3 (I want them to enter the info in different forms) forms say:
Choose Category:
Choose subcategory:
Material:
Amount spent:
Form for labour:
Choose Category:
Choose subcategory:
Worker:
Worked hours:
and for rental:
Choose Category:
Choose subcategory:
Rental:
Amount spent:
Whatever they enter goes to the same table "control", to the proper fields projectID, catID, subID, matID, matExpenses, workerID, workedHours (worker wage is from a different table), rentID, rentExpenses.
So let's say they want to see how much money they spent in the category "Concrete" (which has many subcategories), they select that from the form and the report should show the following:
Category: Concrete
Subcategory: Sub1
Material for Sub1: 300
Labour for Sub1: 6000
Rentals for Sub1: 200
Sub1 Subtotal: 6500
Subcategory: Sub2
Material for Sub2: 800
Labour for Sub2: 5000
Rentals for Sub2: 200
Sub2 Subtotal: 6000
And son on
I'm getting lost with the query. How do I do to display the money spent per item (material, labour and rental) per subcategory?
Thanks in advance.
This is for a construction company. Everyday the enter the information of what was done that day and how much money in material, rental and labour they spent. At the same time, this is entered by category and subcategory. So let's say my 3 (I want them to enter the info in different forms) forms say:
Choose Category:
Choose subcategory:
Material:
Amount spent:
Form for labour:
Choose Category:
Choose subcategory:
Worker:
Worked hours:
and for rental:
Choose Category:
Choose subcategory:
Rental:
Amount spent:
Whatever they enter goes to the same table "control", to the proper fields projectID, catID, subID, matID, matExpenses, workerID, workedHours (worker wage is from a different table), rentID, rentExpenses.
So let's say they want to see how much money they spent in the category "Concrete" (which has many subcategories), they select that from the form and the report should show the following:
Category: Concrete
Subcategory: Sub1
Material for Sub1: 300
Labour for Sub1: 6000
Rentals for Sub1: 200
Sub1 Subtotal: 6500
Subcategory: Sub2
Material for Sub2: 800
Labour for Sub2: 5000
Rentals for Sub2: 200
Sub2 Subtotal: 6000
And son on
I'm getting lost with the query. How do I do to display the money spent per item (material, labour and rental) per subcategory?
Thanks in advance.