Hi
I have a problem with a aggregate function in a query, and that I hope someone can help me with.
The hole query is way more complex than this but i have cut out the problem part. I have 3 fields as below. As you can see the article field is not uniqe.
Article, Price, Date of Pricing
A01 3,95 040601
A01 2,90 040201
A02 4,90 040302
A02 3,50 040101
I want a result that for every article takes out the
highest date of pricing and what the price is.
The result should look like this:
A01 3,95 040601
A02 4,90 040302
I have tried the following query:
Select Article, Price, MAX(Date of Pricing) from X group by Article, Price
Of course all the article will come out as a result beqause the price field and that is what I want to know. Can I use another way to get the right result. As I said before the hole query is way more complex so I hope I can do it without a sub query or similiar but if thats the only way there is please help me with that to.
Thanks in advance
I have a problem with a aggregate function in a query, and that I hope someone can help me with.
The hole query is way more complex than this but i have cut out the problem part. I have 3 fields as below. As you can see the article field is not uniqe.
Article, Price, Date of Pricing
A01 3,95 040601
A01 2,90 040201
A02 4,90 040302
A02 3,50 040101
I want a result that for every article takes out the
highest date of pricing and what the price is.
The result should look like this:
A01 3,95 040601
A02 4,90 040302
I have tried the following query:
Select Article, Price, MAX(Date of Pricing) from X group by Article, Price
Of course all the article will come out as a result beqause the price field and that is what I want to know. Can I use another way to get the right result. As I said before the hole query is way more complex so I hope I can do it without a sub query or similiar but if thats the only way there is please help me with that to.
Thanks in advance