View previous topic :: View next topic |
Author |
Message |
Elster Beginner
Joined: 24 Jan 2008 Posts: 5 Topics: 2
|
Posted: Wed Jun 04, 2008 7:13 am Post subject: QMF SQL Contains Variable |
|
|
Good day.
Using QMF for Windows, trying to run a query where the user will enter in a value, and the results will be one column which contains the entered value ANYWHERE in that column.
Code: | SELECT
A.ITEM1_DESC
,A.ITEM_NBR
,A.ITEM_SERIAL_NBR
Q9FRARM.FIREARM A
where
(A.item_serial_nbr CONTAINS &SerialNumberinsinglequotes)
|
The above does not like the CONTAINS verb.
When executing the above, It brings up a panel to enter the variable field. This value would be entered as
'ABCD'
The query should check all instances of A.item_serial_nbr, and return all records containing ABCD anywhere in the data.
Results:
ABCDEFG
XYZABCD
RAYABCD1234
I have checked several manuals, tried numerous variations of the above, and asked several team mates with no success. Appreciate your assistance. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Jun 04, 2008 7:41 am Post subject: |
|
|
Can you do something along the lines of:
LIKE '%'||hostvar||'%'
? _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
Elster Beginner
Joined: 24 Jan 2008 Posts: 5 Topics: 2
|
Posted: Wed Jun 04, 2008 10:13 am Post subject: |
|
|
It must have been the (hic) BARS.
We tried the % and single quotes, but not the BARS (hic)
Fantastic - many thanks!! |
|
Back to top |
|
 |
|
|