Group by last date

  • Thread starter samotek via AccessMonster.com
  • Start date
S

samotek via AccessMonster.com

Can somebody help me build a query that groups the 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 ?
 
J

Joe Cilinceon

samotek said:
Can somebody help me build a query that groups the 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 ?

Add [orders].[invoicedate] > #last orderdate# to the following
WHERE ((([orders].[paymentid])>0))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top