A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to get each item, Last date it was sold



 
 
Thread Tools Display Modes
  #1  
Old November 9th, 2009, 08:42 PM posted to microsoft.public.access.forms
Abe Katz
external usenet poster
 
Posts: 43
Default How to get each item, Last date it was sold

Hello All,

I need a list from All the Items in the Inventory, the Last Date each item
was sold, and the qty sold on that date.
Doug Steele told me to use a subquery, it works fine with one table but when
I have a Header and a Detail table (the date is in the Header) I cant get it
to work.

The following code works fine with one table (date and StyleNo, Qty are in
the same table).
I need the same query with an Invoice table, where the Date is in the Header
and StyleNo and Qty is the Detail table.
Can any body please figure out how to do it?
Thank you very much I really appreciated.

SELECT A.StyleNo, A.DateRcv AS DateLastPur, Sum(A.Qty) AS QtyPur
FROM [tblPOrder RcvdDT] AS A
GROUP BY A.StyleNo, A.DateRcv
HAVING (((A.StyleNo) Between "A100" And "B100") AND ((A.DateRcv) In (SELECT
Max(DateRcv) FROM [tblPOrder RcvdDT] WHERE StyleNo=A.StyleNo)));

Abe


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.