× 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.



The following is a query a user is trying to create for an interactive query in QMF for Windows and/or DB2 Query Manager. The problems they encounter are:

- Conversion errors between columns containing input from substitution variables and the derived column in the SELECT statement (this happens if the query is run as written here)

OR

- taking the single quotes off the derived column name as used in the WHERE clause causes a "Column not found in tables" error.

As you can probably see what the user/developer is trying to do is take four columns that are zoned decimal and make a column that essentially takes the data from those separate columns and makes it one and then use that column to discriminate rows based on the variable input from the end user when the query is run. For the end user this means two variables to enter rather than eight.

Any help appreciated. Thanks, Dave

SELECT B.UTCSNM, B.UTCSA2, B.UTCSA3, B.UTCSZP, E.ASANTX, E.ASCICD, A.UTLCID,
A.UTCSID, A.UTSVC, A.UTSSTS, A.UTSSTC, A.UTSSTY, A.UTSSTM, A.UTSSTD,
C.UTACTP, B.UTCSST, D.ABABTX, D.ABCHCD, D.ABACCD, D.ABAECD, D.ABDFCD,
D.ABBPCD,
( ( 1900 + A.UTSSTC * 100 ) + A.UTSSTY ) * 10000 + A.UTSSTM * 100 + A.UTSSTD
AS CUSTSTARTDATE
FROM CXLIB.UT220AP A INNER JOIN CXLIB.UT200AP B ON B.UTCSID = A.UTCSID INNER
JOIN CXLIB.UT120AP C ON C.UTSVC = A.UTSVC AND C.UTLCID = A.UTLCID INNER
JOIN LXLIB.LMABREP D ON D.ABAUCD = A.UTLCID INNER JOIN LXLIB.XXASREP E ON
E.ASBPCD = B.UTCSZP
WHERE (A.UTSVC = 'MS')
AND (A.UTSSTS = 'A')
AND NOT (C.UTACTP = 'NC')
AND ('CUSTSTARTDATE' >= &BeginningDate)
AND ('CUSTSTARTDATE' <= &EndingDate)

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.