I?ve built a query, based on table containing public school student demographic data, using query utilities (i5/os, V5R3) which prompts for a value when run. The criteria in the ?select records? panel is FIELDLASTNAME EQ :FIELDLASTNAME.
When I run STRQMQRY QMQRY(LIBRARY/QUERYNAME) ALWQRYDFN(*YES) QMFORM(*QMQRY) from the a command line, the system prompts me for FIELDLASTNAME. This is what I want.
However, as it stands now, users have to type in a complete last name enclosed by single quotes for the query to return results. I?ve been trying with no success to get it to work with a partial last name search. Additionally, query utilities won?t allow me to combine the dependent column parameter (:FIELDLASTNAME) with the LIKE test.
I just want to be able to enter something like SM% to pull all SMITHS, etc. when prompted and keep things simple.
Any insights would be greatly appreciated.
Software/Hardware used:
ASKED:
May 3, 2006 3:29 PM
UPDATED:
December 6, 2009 11:23 AM
I created query RUNSQLTST as a QMQRY:
SELECT * FROM SFPARMS WHERE KEYFIELD LIKE &KEY
After creating it:
CRTQMQRY QMQRY(RUNSQLTST) SRCFILE(QQMQRYSRC)
I ran this from the command line:
STRQMQRY QMQRY(RUNSQLTST) SETVAR((TEST ”’RSE%”’))
Note the extra quotes around the value. This ran correctly and select everything that started with RSE.
I hope this helps.