Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2005
    Posts
    23

    Unanswered: Group by last date

    Can somebody help me built a query grouping payments from the last date.
    I have a working and valid query as follows


    SELECT [orders].[paymentid], Sum([order details].[liters]) AS SumOfLiters, [orders].[invoicedate]
    FROM orders INNER JOIN [order details] ON [orders].[orderid]=[order details].[OrderID]
    WHERE ((([orders].[paymentid])>0))
    GROUP BY [orders].[paymentid], [orders].[invoicedate];

    It shows the liters for each payment as well as the invoice date.
    How can i force the query to show only the payments with an invoice date from the last date ?

  2. #2
    Join Date
    Jan 2005
    Posts
    31
    Quote Originally Posted by samotek
    Can somebody help me built a query grouping payments from the last date. I have a working and valid query as follows
    [...]
    It shows the liters for each payment as well as the invoice date. How can i force the query to show only the payments with an invoice date from the last date ?
    Do you mean, "Only payments made on the most recent invoice date?"

    I see a paymentid column in orders, but no column for payments. "paymentid" implies that payments are kept in another table. What is the name of that table and the name of the column containing the payments?

    Note: Although meant for SQL Server, the following link is still applicable for MS Access: http://www.aspfaq.com/etiquette.asp?id=5006, and is excellent when it comes to detailing how to provide the information that will best enable others to answer your questions.

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    whatsamatta, samotek, you didn't like my answer on tek-tips?

    sheesh!!
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Jan 2005
    Posts
    31
    Quote Originally Posted by r937
    whatsamatta, samotek, you didn't like my answer on tek-tips?

    sheesh!!
    The same question was posted to microsoft.public.access.queries via AccessMonster.com.

    It looks like the question was multi-posted everywhere.

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    well, i wish buddy would pay as much attention to the answers he actually gets instead of ignoring them and asking the same thing elsewhere
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    441
    Forgot the post at CDMA under the handle "solar", I guess ...
    Roy-Vidar

Posting Permissions

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