Hi
I am trying to get out of a table of cost price changes the last date a cost was changed for products.
I am trying just on one code at the moment to simplify things. My code is as below but I am getting the error An expression of non-boolean type specified in a context where a condition is expected, near ')'
I tried to change the date format but still get the same issue. Any ideas please. Thanks
I am trying to get out of a table of cost price changes the last date a cost was changed for products.
I am trying just on one code at the moment to simplify things. My code is as below but I am getting the error An expression of non-boolean type specified in a context where a condition is expected, near ')'
I tried to change the date format but still get the same issue. Any ideas please. Thanks
Code:
SELECT Format([ChangeDateTime],'dd/MM/yyyy') AS Date, ProductID, AverageCostPriceWithAdditional, LastCostPriceWithAdditional
FROM ProductPriceHistory
Group by ProductPriceHistory.ProductID, ProductPriceHistory.AverageCostPriceWithAdditional,ProductPriceHistory.LastCostPriceWithAdditional,ProductPriceHistory.ChangeDateTime
HAVING ProductID = 47561 AND MAX(ProductPriceHistory.ChangeDateTime)