Hi All,
I am new to this forum and new to VBA n SQL skill set. Need your advice and direct me to the right path if i am wrong.
As a part of my case study, I got a scenario to produce the Employee report for the list of years.
It has following fields named Year, Name, Designation, DOJ, Salary (from table EMPLOYEE) and Total. I write a simple SQL query and produce the values in the report by mapping the corresponding fields.
-------------------------------------------------------------------
ANNUAL FISCALE REPORT - EMPLOYEE HUB
-------------------------------------------------------------------
Year Name Designation DOJ SALARY TOTAL
2015 TEST1 MANAGER 24/05/2015 $12,000.00
TEST2 VP 12/05/2015 $15,000.00
TEST3 VC 01/04/2015 $13,500.00 $40,500.00
2014 TEST4 MANAGER 25/03/2014 $15,000.00 $15,000.00
2013 TEST5 MANAGER 03/12/2013 $12,000.00
TEST6 VP 23/08/2013 $18,000.00 $20,000.00
-----------
$75,500.00
I have below listed conditions should be satisfied for the aforementioned requirement of report.
YEAR column: Display Value only once for the FIRST ROW for Maximum value of DOJ field value for each set of YEAR. If it has only one record, it display that year.
I will be writing my SQL QUERY ORDERBY DATE_OF_JOINING (DOJ) in DESCENDING sequence. So it will display the records in aforementioned order. But i have no clue how to supress or reset the YEAR value for other records (Other than first row) for each set of year
TOTAL Column: Display Total Value for SALARY field only once for the LAST ROW of each set of year record. I will use SUM function to add those salary fields to get total value. While displaying, how to make it available only for last record alone ?
I have no clue whether its doable in a single query to find the required values, max and min of DOJ, and write logic to populate the total salary for mininum DOJ?
Else is it possible to make it in recordset by writing couple of queries and write logic to achieve it?
Its for REPORT.. not FORM.. kindly advice.
I am new to this forum and new to VBA n SQL skill set. Need your advice and direct me to the right path if i am wrong.
As a part of my case study, I got a scenario to produce the Employee report for the list of years.
It has following fields named Year, Name, Designation, DOJ, Salary (from table EMPLOYEE) and Total. I write a simple SQL query and produce the values in the report by mapping the corresponding fields.
-------------------------------------------------------------------
ANNUAL FISCALE REPORT - EMPLOYEE HUB
-------------------------------------------------------------------
Year Name Designation DOJ SALARY TOTAL
2015 TEST1 MANAGER 24/05/2015 $12,000.00
TEST2 VP 12/05/2015 $15,000.00
TEST3 VC 01/04/2015 $13,500.00 $40,500.00
2014 TEST4 MANAGER 25/03/2014 $15,000.00 $15,000.00
2013 TEST5 MANAGER 03/12/2013 $12,000.00
TEST6 VP 23/08/2013 $18,000.00 $20,000.00
-----------
$75,500.00
I have below listed conditions should be satisfied for the aforementioned requirement of report.
YEAR column: Display Value only once for the FIRST ROW for Maximum value of DOJ field value for each set of YEAR. If it has only one record, it display that year.
I will be writing my SQL QUERY ORDERBY DATE_OF_JOINING (DOJ) in DESCENDING sequence. So it will display the records in aforementioned order. But i have no clue how to supress or reset the YEAR value for other records (Other than first row) for each set of year
TOTAL Column: Display Total Value for SALARY field only once for the LAST ROW of each set of year record. I will use SUM function to add those salary fields to get total value. While displaying, how to make it available only for last record alone ?
I have no clue whether its doable in a single query to find the required values, max and min of DOJ, and write logic to populate the total salary for mininum DOJ?
Else is it possible to make it in recordset by writing couple of queries and write logic to achieve it?
Its for REPORT.. not FORM.. kindly advice.