PDA

View Full Version : Issue in Suppressing field value in REPORT - For MAX and MIN of Date field.



Balaryan58
06-24-2015, 09:08 AM
Hi Friends,Good day. I am new to this forum and VBA query task. Kindly bare with my less knowledge on this. 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 TOTAL2015 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.002014 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 ? Need your expert opinion and advice me how to proceed on this. Let me know if any other info required.

Balaryan58
06-26-2015, 02:28 AM
Any suggestion on this query from any expertise?

Balaryan58
06-26-2015, 10:38 AM
13793

jonh
06-26-2015, 11:07 AM
You can't suppress values like that. You would need to code it yourself, e.g. by outputting to html or something.

jonh
06-26-2015, 11:09 AM
... unless there's a new feature I don't know about.

Balaryan58
07-01-2015, 09:11 AM
... unless there's a new feature I don't know about.

Hi John,

Actually I need to write a query to display those results in a REPORT.

My question here is "Is it possible to provide solution by writing a SINGLE query to get the desired output or do I need to write couple of queries to achieve this using recordset" ??

If its doable using recordset, is it possible to get it done in REPORT OPEN() or only its achievable in FORM OPEN()?

Kindly advice.