WRKQRY’S USE TO ADD NUMERIC FIELD’S RECORDS

1,485 pts.
Tags:
AS/400
WRKQRY
How can i add up the records of my physical file's numeric field lets say Esal's records using wrkqry?

Please help me by an appropriate code example.

thanks in advance.

 

 



Software/Hardware used:
AS/400
ASKED: December 20, 2009  7:20 AM
UPDATED: December 21, 2009  4:32 PM

Answer Wiki

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

If I understand the question correctly, you want to sum a numeric field in a file using AS/400 Query.

Select the “Select report summary functions” option and put a 1 next to the field you want to sum.

Discuss This Question: 1  Reply

 
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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    I'm only discussing the question, not attempting to answer it. Personally, I'd skip that entirely and do the work with a QM query instead. To produce a sum over a field named FLD1 in a file named MYFILE in a library named MYLIB, I'd put this statement into a source member:
    select sum( FLD1 ) from MYLIB/MYFILE
    Then I'd create the QM query with the CRTQMQRY command and run it with the STRQMQRY command. That assumes I didn't have the SQL Dev Kit installed. If I was entitled to it, I'd install it. If it was installed, I'd simply work through the STRQM command. If I already knew Query/400, I'd start my work with the 'Prompted' mode and move to SQL mode later. If I was already comfortable with SQL, that's the mode I'd start with. I don't know if Query/400 (now apparently renamed Query for i5/OS) has been meaningfully updated since OS/400 V4. I won't be surprised if it's never updated again. Tom
    125,585 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following