Hi, I have been searching and have not been able to find a case identical to mine. I have 9 boxes a user can check. The boxes represent the different types of owners that are in the database. If more than one box is checked, I want all the records that meet one or more of the checked boxes. so all my where statements would need an 'OR' between each one. However, I cannot use foc_none because then the whole line is ignored when it sees a single foc_none. If they check one box, they don't need an 'or'. But if they check 3 boxes, I need a where statement for each box separated by 'OR'. It is handling the OR I am having a problem with. The only thing I could come up with is to have a counter and increase it once I add the second where statemnt, thus I can code an 'OR' in there if the cntr is greater than 1. I am using dialog mgr to navigate around each statement. Any other suggestions or better ideas?
Thank you.This message has been edited. Last edited by: Kerry,
Kathy Phillips Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03 Windows
October 22, 2009, 04:24 PM
GinnyJakes
Generate the WHERE statement dynamically in Dialogue Manager checking all of your conditions and then use that variable in the TABLE part.
Just make sure that each separate OR criteria is on its own line. A 'FOC_NONE' doesn't cause the whole WHERE to be ignored only the single PHYSICAL line of code in which it appears.
WHERE fieldname EQ 'value' OR fieldname EQ 'value' . . . ;
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
October 23, 2009, 05:57 AM
Tewy
You could use IN instead of OR e.g.
WHERE fieldname IN ( &var1 &var2 &var3 )
You can then use FOC_NONE as long as at least one &var has a value.
WF 7.6.11 Output: HTML, PDF, Excel
October 23, 2009, 08:01 AM
Kathy P
Darin, Thank you for your input. I did have each filter on it's own line using foc_none and my output results were not correct. It did occur to me my first two screening conditions, one of them would always be used. There is only one business size check box on the html. Therefore, I could prefix the rest of the filters with 'or'. Here is what I did. Ginny, thanks for your suggestion. Being the end of the day, sometimes I need another set of eyes.