Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Thanked 0 Times in 0 Posts

    OrderBy not valid (Access 2000)

    I have a query where the sorting per liters works, as in: ORDER BY Sum([order details].liters) DESC;
    I have converted this query into an sql and made it the record source of the report.I have made the query dependant on the choice of the month, by choosing from the option box " Monaten" in the form "Switchboard" :
    WHERE (((Month([invoicedate])) = Forms!Switchboard!Monaten)

    However in that case the sorting per liters is lost, and I have the report opened correctly, but the results are not sorted per liters in descending order, even though I have the sorting in the SQL :
    " WHERE (((Month([invoicedate])) = Forms!Switchboard!Monaten) And ((products.size) > 1) And ((orders.paymentid) > 0) And ((Year([invoicedate])) = " & CnstYear & "))" & _
    " GROUP BY Customers.Customerid, Customers.CompanyName, ORDER BY Sum([order details].liters) DESC;"

    How could I make the sorting work in the report ?

  2. #2
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Chelsea, Gtr London, United Kingdom
    Thanked 0 Times in 0 Posts

    Re: OrderBy not valid (Access 2000)

    Reports ignore the underlying sort order of an SQL query. You need to set the sort order specifically in the Grouping and Sorting dialog.
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts