Focal Point
[SOLVED] Syntax for a Multi-selection Parameter (OR)

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2787061826

January 23, 2013, 10:55 AM
kitten
[SOLVED] Syntax for a Multi-selection Parameter (OR)
I am trying to get the syntax below to prompt me twice for field value. Want to use an OR in a where clause with Parameters. It seems that the follow should work but I only get prompted once. Can someone please assist. Smiler WHERE END_DATE EQ '&END_DATE' OR '&END_DATE';

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6.2, MS Windows Server/______, Excel, PDF, HTML
January 23, 2013, 11:14 AM
Doug
Just use distinct variable names, such as &DATE1 and &DATE2.

WHERE END_DATE EQ '&DATE1' OR '&DATE2';

Keep Smiling Smiler




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
January 23, 2013, 11:37 AM
kitten
How would you do the Date2. Would you create a define or print the field twice changing one of the fields to Date2.


WebFOCUS 7.6.2, MS Windows Server/______, Excel, PDF, HTML
January 23, 2013, 11:47 AM
Doug
quote:
END_DATE' OR '&END_DATE';

Just -DEFAULT them both. Are you using Auto Prompting of have you created a lauch page for this fex?
January 23, 2013, 01:09 PM
kitten
I will be creating a launch page once I get it to work.


WebFOCUS 7.6.2, MS Windows Server/______, Excel, PDF, HTML
January 23, 2013, 01:10 PM
kitten
I created a define.


WebFOCUS 7.6.2, MS Windows Server/______, Excel, PDF, HTML
January 23, 2013, 02:24 PM
Doug
The DEFINE would use &DATE1 and &DATE2, as would the launch page...

One of many ways (this one's explicit):
DEFINE FILE MyFile
ShowThisRecord/A3 = IF END_DATE EQ &DATE1 OR END_DATE EQ &DATE2 THEN 'YES' ELSE 'NO' ;
END
TABLE FILE MyFile
DO THIS
WHERE ShowThisRecord EQ 'YES'

So many other ways...
January 24, 2013, 11:02 AM
Mighty Max
I always go to the GUI to determine the syntax for a Multi-Select OR. I always forget because I do not use it that much. The syntax is different based on whether it is a static list or a dynamic list that comes from a master.

  
TABLE FILE CAR
PRINT 
     COUNTRY
     CAR
     MODEL
HEADING
""
FOOTING
""
WHERE COUNTRY EQ &COUNTRY.(OR(<C1Text,C1Value>,<England,ENGLAND>)).Country.;
WHERE CAR EQ &CAR.(OR(FIND CAR,CAR IN CAR)).Car.;
ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
$
ENDSTYLE
END



WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
January 30, 2013, 02:19 PM
kitten
Thanks Doug, the define worked but the simple distinct variable names worked just as well. Much easier.

Also thanks Mighty Max, I will experiment with the GUI. Issue solved.


WebFOCUS 7.6.2, MS Windows Server/______, Excel, PDF, HTML