5 pts.
 Display “No records found” in a QMQRY
I have a QMQRY that selects data from several files using left joins. Based on my "where" clause there is a possibility that no records will be selected. In this case, I want to be able to print "NO RECORDS FOUND" on the report. I have not been able to figure out how to get that text to print on the report. Any suggestions?

Software/Hardware used:
ASKED: April 8, 2009  1:38 PM
UPDATED: April 10, 2009  1:54 PM

Answer Wiki:
You should be able to check the number of records in the output file via the Count(*) function to see whether to print that message, or possibly a pre-select using that same function to see if there are any records which meet your criteria - but as far as how to actually print that message, I am not aware of a way to do that either with QM or with Query/400. It does't appear that either one supports conditional logic in the report options or allows adding a custom text message. ================================================================================ Here is a thought. Inside of your query do you have some type of description or message field that is being filled from one of hte physical file fields? If so then using a Case Statement you could place your message in that field if you find that a specific field from each of the other files is null. For Example Case When FILEA.FIELD1 is null and FILEB.FIELD2 is null and etc. (More conditions) then "NO RECORDS FOUND" Else FILEA.FIELD1 END
Last Wiki Answer Submitted:  April 10, 2009  1:54 pm  by  FCARPENTER   200 pts.
All Answer Wiki Contributors:  FCARPENTER   200 pts. , Cwc   4,275 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _