Query/400 to give Column totals

260 pts.
Tags:
AS/400
SQL
Hello, I would like to use Query/400 to provide a particular column total. I have about 6 fields and the final field is Inventory Cost that needs to be totaled in the end in the database file. I know it is easier over SQL, but I would like to know if this is possible.
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

In “Select report summary funcitions” you may 1) total, 2) average, 3) identifiy the lowest value (minimum) 4) identify the largest value (maximum) or 5) count. Any numeric column. Alpha and date columns of course you cannot total or average, but the other functions would work. In the situation you described, you would use 1 on the last column.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    Are you looking for something simple like subtotals? Then just use the sum function on the column. If it more involved, provide more info as to what the end result is.
    Is this to be a file, report, detail with totals, summary data only.......
    Have you looked at QMQUERY?
    133,790 pointsBadges:
    report
  • TheRealRaven
    If you know how to do it with SQL why would you ever care about Query/400? I'm with ToddN2000. Use QM queries instead. Much more flexible (and no extra cost like Query/400 if you already have the SQL Dev tools installed.)
    35,660 pointsBadges:
    report
  • ToddN2000
    It may be a case like we have here. We have some users with very limited skills using WRKQRY to generate their own simple reports. They may want a slightly more advanced report and then call the IT department to create it for them.
    133,790 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: