A
Andy
Hi,
I have several tables in my database..
Products, Customer, Items, Supplier.
The Items is a kind of transaction table that stores
every product sold.
What I want to achieve is a query that will only show the
last entry (based on the last date) of the item table,
but also including desciption fields from other tables. I
just wnt to be able to see what the last price a product
was sold to somebody (which is why i was thinking to use
Last on the date field) By the way the date field is
sorted.
The problem is that each time an item is recorded, the
cost and sell price are likely to be different, therefore
I want to be able to see every product sold for each
customer (grouped by the Product) so there may be many
boots sold to the same customer and from the same
supplier but different date and sell/cost prices. It is
just the last date for each different product that I want
to show
e.g
CustomerName ProdDesc Date Cost Sell Supplier
=========================================================
Joe Bloggs Boots 10/06/04 20.00 40.00 BootsRUs
Joe Bloggs Jacket 09/06/04 15.00 35.00 JktsRUs
John Smith Jacket 05/06/04 15.00 35.00 JktsRUs
etc etc
The query I have setup gets info from the user for the
customer name and the product description (although
either or both of these can be left blank to return all)
When I run the query, it is still showing all items and
not just the latest date for that product, even though I
have used Last([Date]). I know I must be doing something
wrong.....but WHAT
I hope I am making myself clear ??
Any help would be appreciated
Thanks
Andy
I have several tables in my database..
Products, Customer, Items, Supplier.
The Items is a kind of transaction table that stores
every product sold.
What I want to achieve is a query that will only show the
last entry (based on the last date) of the item table,
but also including desciption fields from other tables. I
just wnt to be able to see what the last price a product
was sold to somebody (which is why i was thinking to use
Last on the date field) By the way the date field is
sorted.
The problem is that each time an item is recorded, the
cost and sell price are likely to be different, therefore
I want to be able to see every product sold for each
customer (grouped by the Product) so there may be many
boots sold to the same customer and from the same
supplier but different date and sell/cost prices. It is
just the last date for each different product that I want
to show
e.g
CustomerName ProdDesc Date Cost Sell Supplier
=========================================================
Joe Bloggs Boots 10/06/04 20.00 40.00 BootsRUs
Joe Bloggs Jacket 09/06/04 15.00 35.00 JktsRUs
John Smith Jacket 05/06/04 15.00 35.00 JktsRUs
etc etc
The query I have setup gets info from the user for the
customer name and the product description (although
either or both of these can be left blank to return all)
When I run the query, it is still showing all items and
not just the latest date for that product, even though I
have used Last([Date]). I know I must be doing something
wrong.....but WHAT

I hope I am making myself clear ??

Any help would be appreciated
Thanks
Andy