Hi
we have a table that holds Product Information. Frome time to time we need to update these tables ,manually through our business system. Tis takes a lot of time to do.
I created a query that updates the fields but I need it to be a little more intelligent (fairly a novice in writing code)
Our ProductID will have ten rows, as we have 10 sites if I do a select *
The fields I want to update work ok like I have it however if the 2 fields called Stocklevelmin and Stocklelvemax have anything other than 0 in them then I do not want any of the 10 rows to update. below is my update statement as I have it, but I do not want it to run if any of the rows have any other figure in stocklevelmin and stocklevelmax than 0. I only want it to update all 10 rows it the figure is 0.
UPDATE ProductStockOption
SET Stocked='0', StandardPurchase='0',stockclass ='O', HowSourced = '0'
where ProductID = 34797;
Could someone advise how the code should be to achieve this please. I have looked ah If Else but cannot work out the syntax.
Thanks
we have a table that holds Product Information. Frome time to time we need to update these tables ,manually through our business system. Tis takes a lot of time to do.
I created a query that updates the fields but I need it to be a little more intelligent (fairly a novice in writing code)
Our ProductID will have ten rows, as we have 10 sites if I do a select *
The fields I want to update work ok like I have it however if the 2 fields called Stocklevelmin and Stocklelvemax have anything other than 0 in them then I do not want any of the 10 rows to update. below is my update statement as I have it, but I do not want it to run if any of the rows have any other figure in stocklevelmin and stocklevelmax than 0. I only want it to update all 10 rows it the figure is 0.
UPDATE ProductStockOption
SET Stocked='0', StandardPurchase='0',stockclass ='O', HowSourced = '0'
where ProductID = 34797;
Could someone advise how the code should be to achieve this please. I have looked ah If Else but cannot work out the syntax.
Thanks