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



Marco,

First, some questions.
Are we talking about a character, or a numeric field?
Was the Query detail, or summary output?

I created a file with a 12 character field, and a 12 digit decimal field.
I ran a Query of that to an output file, detail. No change in field
attributes occurred.
Then I deleted the output file and changed the query from a detail, to a
summary. I selected the maximum of the character field, and the total of
the decimal field. The character field was unchanged, but the decimal
field is now 15. Even though in report column formatting it is still set
to 12.

I think they do this in case the summary is larger than the current field.
For example, the sum of these fields would be more than 12,0.
999999999999
999999999999
So Query takes a WAG and expands it out to 15. No, you may "know" that
the sum is not going to be a problem. But you really can't convey that to
Query.

Instead of Query/400, you could do the following in SQL:
CREATE TABLE QTEMP.MARCO2 AS (
SELECT MAX(MYCHAR) AS MYCHAR,
CAST(SUM(MYDEC) AS DEC(12,0)) AS MYDEC
FROM QTEMP.MARCO)
WITH DATA
Table MARCO2 created in QTEMP.


Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.