Beginner Help Again - Queries

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom Keane

    #1

    Beginner Help Again - Queries

    Hello again peoples! Okay, I have a problem to put to you guys. I don't know
    if this is possible or not, but yeah.

    What I am doing is performing a query that displays records of people
    according to the invoice number I chose...

    For example, I do a query for Invoice #4739 and the following will come up:

    JobNo Name Amount

    100 Jimmy $50
    100 Timmy $55
    100 Bob $22
    102 Todd $50
    102 Ted $70

    Anyway, you get the picture. What I want the query to do is only display one
    record from each job number, so when I do the query, it will come up with
    something like this:

    JobNo Name Amount

    100 Jimmy $50
    102 Todd $50

    Anyways, something like that. If this is possible, could someone please
    please tell me how to do it. It would be GREATLY appreciated. ;)
    Thanks alot peeps!

    Tom K.


  • Mark Reed

    #2
    Re: Beginner Help Again - Queries

    One way of doing this (others may have a better solution) would be to select
    the first record in the name and amount fields. Something like:

    SELECT your_table.[job no], First(your_tabl e.name) AS name,
    First(your_tabl e.amount) AS amount
    FROM your_table
    GROUP BY your_table.invo ice, your_table.[job no]
    HAVING (((your_table.i nvoice)=4739));

    Regards,

    Mark

    "Tom Keane" <landtkeane@opt usnet.com.au> wrote in message
    news:40f5e893$0 $18668$afc38c87 @news.optusnet. com.au...[color=blue]
    > Hello again peoples! Okay, I have a problem to put to you guys. I don't[/color]
    know[color=blue]
    > if this is possible or not, but yeah.
    >
    > What I am doing is performing a query that displays records of people
    > according to the invoice number I chose...
    >
    > For example, I do a query for Invoice #4739 and the following will come[/color]
    up:[color=blue]
    >
    > JobNo Name Amount
    >
    > 100 Jimmy $50
    > 100 Timmy $55
    > 100 Bob $22
    > 102 Todd $50
    > 102 Ted $70
    >
    > Anyway, you get the picture. What I want the query to do is only display[/color]
    one[color=blue]
    > record from each job number, so when I do the query, it will come up with
    > something like this:
    >
    > JobNo Name Amount
    >
    > 100 Jimmy $50
    > 102 Todd $50
    >
    > Anyways, something like that. If this is possible, could someone please
    > please tell me how to do it. It would be GREATLY appreciated. ;)
    > Thanks alot peeps!
    >
    > Tom K.
    >
    >[/color]


    Comment

    Working...