C
ChrisC
Hi there,
i'm trying to make a query to get the latest price change for my products.
This is what i have in SQL (don't pay attention to the names for i am dutch
speaking):
SELECT Prijsaanpassing.DatPrijsAanp, Prijsaanpassing.EHPrijs,
Prijsaanpassing.Portkosten, Prijsaanpassing.KPInSet,
Prijsaanpassing!EHPrijs+Prijsaanpassing!Portkosten AS Totaalprijs,
Prijsaanpassing.ProductId
FROM Prijsaanpassing
ORDER BY Prijsaanpassing.DatPrijsAanp DESC;
When i run this query i get every price change for every product. I tried to
limit the results by using the group by and max for the date field
(DatPrijsAanp). This works fine as long as the price (EHPrijs) isn't in the
query. Putting both date and price to 'max', gives wrong results.
Any idea how this can be done?
Thanks,
Chris
i'm trying to make a query to get the latest price change for my products.
This is what i have in SQL (don't pay attention to the names for i am dutch
speaking):
SELECT Prijsaanpassing.DatPrijsAanp, Prijsaanpassing.EHPrijs,
Prijsaanpassing.Portkosten, Prijsaanpassing.KPInSet,
Prijsaanpassing!EHPrijs+Prijsaanpassing!Portkosten AS Totaalprijs,
Prijsaanpassing.ProductId
FROM Prijsaanpassing
ORDER BY Prijsaanpassing.DatPrijsAanp DESC;
When i run this query i get every price change for every product. I tried to
limit the results by using the group by and max for the date field
(DatPrijsAanp). This works fine as long as the price (EHPrijs) isn't in the
query. Putting both date and price to 'max', gives wrong results.
Any idea how this can be done?
Thanks,
Chris