Hi,
Missing a space between the word SELECT and the word MAX.
You can also remove the
GROUP BY to2.[ndc]
Hoping it may help,
Vanderghast, Access MVP
Thank you very mucho for your response. Following your recommendation
I
wrote the following:
SELECT Price_Table.[NDC ], Price_Table.DESC, Price_Table.Fecha
FROM Price_Table to1
WHERE to1.Price_Table.Fecha = (selectmax(to2.Price_Table.Fecha)FROM
Price_Table to2 WHERE to1.[ndc] = to2.[ndc] GROUP BY to2.[ndc]);
I'm obtaining the following error: Syntax error missing operator y
query
expression.
What Im doing wrong?
:
Change the name of your 'date' column to something like 'itemdate'.
Date
()
is a VB function used to return the current date. As such, it should
not
be
used as a name.
Having said that, try:
SELECT item, itemdate, price, cat, customer, market, pl, comm
FROM tblTestOut to1
WHERE to1.itemdate = (select max(to2.itemdate)FROM tblTestOut to2
where to1.item = to2.item
GROUP BY to2.item)
Good Luck!
--
Chaim
My table has:
"item" "date" "price" "category" "customer" "market" "product line"
"comments"
I want a query that show only the last date of each item.