How to get DISTINCT records using WRKQRY?
Define a report break containing field that you want distinct records. Then in Select Output Type, choose Summary Only. You will only see one occurrences for each distinct break level. The one downside to this is that Query/400 will insert a blank line in between each row.
If you want to print out the data without the blank lines, you can run the output of this query to a temporary file and then query the temporary file separately.
Define a report break containing field that you want distinct records. Then in Select Output Type, choose Summary Only. You will only see one occurrences for each distinct break level. The one downside to this is that Query/400 will insert a blank line in between each row.
If you want to print out the data without the blank lines, you can run the output of this query to a temporary file and then query the temporary file separately.
It will not work for the following condition:
ReplyDeleteEMPID
001
002
003
002...
what is the procedure to select distinct record for the above one..