1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

As400 Help

Discussion in 'Software Development' started by pea333nut, Sep 1, 2004.

Thread Status:
Not open for further replies.
Advertisement
  1. pea333nut

    pea333nut Thread Starter

    Joined:
    Sep 1, 2004
    Messages:
    19
    I need to make a query that that will show all of the customers that an employee in the last year. I set the date greater than 4-01-03 and the employeeNum = to thier number. I get all of the customers that the employee had in the last year but I get duplicates. How do I make it so I only get 1 customer and no duplicates.

    Thanks
     
  2. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    YOu need to add grouping to your query. It will always bring in duplicates the way you made your query because most have probably had more than one customer in that time frame.
     
  3. pea333nut

    pea333nut Thread Starter

    Joined:
    Sep 1, 2004
    Messages:
    19
    what do you mean by add grouping. Can you give me an example!
     
  4. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    SELECT fieldname FROM tablename GROUP BY fieldname
     
  5. pea333nut

    pea333nut Thread Starter

    Joined:
    Sep 1, 2004
    Messages:
    19
    What query definition is this under. This is on an AS400 not SQL or something else.
     
  6. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    Hey, you tell me! SQL is pretty much SQL anywhere you go with minor syntax differences. What database are you running?
     
  7. pea333nut

    pea333nut Thread Starter

    Joined:
    Sep 1, 2004
    Messages:
    19
    I'm just not sure what option to go into to write a statement like the one you supplied. Attached is a print screen. Can you tell me where I would go to write that kind of query statement.

    Thank you very much
     

    Attached Files:

  8. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    You still have not told anyone what type of database or program this is. A little infirmation like that would go a long way in helping you out.
     
  9. angel

    angel

    Joined:
    Dec 2, 1998
    Messages:
    2,736
  10. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/269183

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice