× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Sheri:

Although this isn't an RPG question, I'll answer...

QMQRY is a strange and wonderful thing. I use it often to select data for reports, spreadsheets, etc. But, it does have a few quirks. I wrote an article about it a few years ago which details the process of converting queries to SQL/QMQRY, the problem you're having, and the solution:

http://www.itjungle.com/fhg/fhg052604-story01.html

When passing values to QMQRY, think "text". So, if you want to pass in a numeric value, convert it to text first, then pass that text value in. If you want to pass in an alpha value, you may need to include quote characters around the data, depending on how it is used.

Values passed into QMQRY are really not "variables", but substitution strings. Consider the following:

Select field1
From myfile
Where fieldx = &VALUE

If "fieldx" is a numeric field, you want the "where" clause to read: where fieldx = 123 (or even 0000123). You must pass a character version of the value 123 into QMQRY to do this.

If "fieldx" is a character field, you want the "where" clause to read: where fieldx = 'ABC'. You must pass a character field of minimum length 5 to contain not only your value, but the beginning and ending quote characters.

I hope this helps,
--Bruce Guetzkow




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.