tricky access question using sql

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

    tricky access question using sql

    Hi all,

    I hope you can help me.
    I have a access 2002 database of customers from and they are grouped by
    department in this database. Each record has a sale price for a purchase
    they made with item number. I need to sort them and select from each group,
    the record with the smallest sale price.

    How to do in SQL query?

    Thanks




  • Nicole

    #2
    Re: tricky access question using sql

    "Danny" <dannywork5@hot mail.com> wrote in message news:<KIkWc.240 70$Nk4.8413150@ news4.srv.hcvln y.cv.net>...[color=blue]
    > I have a access 2002 database of customers from and they are grouped by
    > department in this database. Each record has a sale price for a purchase
    > they made with item number. I need to sort them and select from each group,
    > the record with the smallest sale price.
    >
    > How to do in SQL query?[/color]

    Can you define "grouped by department?" Do you have a department
    table, then an customer table?

    It would help if you could post the tables and fields in question.
    Otherwise, I can only suggest you look up the MIN() function and the
    GROUP BY clause.

    Comment

    • Pieter Linden

      #3
      Re: tricky access question using sql

      "Danny" <dannywork5@hot mail.com> wrote in message news:<KIkWc.240 70$Nk4.8413150@ news4.srv.hcvln y.cv.net>...[color=blue]
      > Hi all,
      >
      > I hope you can help me.
      > I have a access 2002 database of customers from and they are grouped by
      > department in this database. Each record has a sale price for a purchase
      > they made with item number. I need to sort them and select from each group,
      > the record with the smallest sale price.
      >
      > How to do in SQL query?
      >
      > Thanks[/color]

      use a totals query and MIN(). See help. Sounds a lot like a homework
      project and a poorly designed database.

      Comment

      Working...