WRKQRY

1,420 pts.
Tags:
CLP
RPG/400
how to write a Query which need to find Count(*all) of field1 group by another field field2 With some internal conditions on other field?

Software/Hardware used:
AS400, RPG,CLLE,
ASKED: September 3, 2013  1:55 PM
UPDATED: September 5, 2013  12:32 AM

Answer Wiki

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

Discuss This Question: 4  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.

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 can't be sure that I understand what you want. It seems like you need a Query/400 query that gives results like this SQL query:

    SELECT count(distinct FIELD1) ,
           FIELD2
     FROM MyTable
     WHERE FIELD3 = 'something'
     GROUP BY FIELD2
     ORDER BY FIELD2

    Please verify if that describes what you are asking for. If it does, then we can probably see how to use Query/400 to do it. I'm not sure why you'd want to use Query/400, though. It's clearly much easier just to use a SQL query.

    Tom

    125,585 pointsBadges:
    report
  • Sai4AS400
    Hi Tom,
    In our Project, we have only work query to use..my requirement is i need to get the total number of accounts for  each Product id. I have these as two different fields in the File.  please let me know how to get required report using Wrkqry..
    1,420 pointsBadges:
    report
  • philpl1jb
    48,545 pointsBadges:
    report
  • TomLiotta
    Is this a class project? A work project should not require the use of an inferior tool when far easier and more productive tools can be used. -- 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