redstarx
-
Posts
1 -
Joined
-
Last visited
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Form that calculates values from different columns between date range
in PHP Coding Help
Posted
Hello,
I've been going about reading different posts on here and other forums but so far I haven't been able to come across something that works for my purpose so after all the reading I thought I'd finally just ask. I'm rather new at php/sql queries so please bare with me.
First what I'm trying to accomplish.
I need a form with several fields (options) to fetch information from a table that will then display the results based on the options selected.
- from date
- to date
- employee name
- department
- branch
- product line
In other words, the purpose is to be able to choose a date range (from one day to up to a year or more) and then to be able to choose either ONE employee name to view statistics invididually from a given department and branch or to select a department to view all the statistics for everyone under that given department and/or brach and/or product line.
Now the tricky part is that besides fetching the records, calculations need to be made before the records are displayed and that part right here is what is giving me a huge headache.
This is the query that I have.
The calculations based on the date range and one or more of the other options need to give me the following results.
I don't know how else to explain myself past this point but if you have any questions, perhaps I can answer it and give more details.
Thank you,