Good morning everybody. I am trying to subtract amounts from one out of five possible fields based on the location of another piece of data using an Access query. Here's a better explanation:
Table to Update: ProductData
Field Names-Location1, Location2, Location3, Location4, Location5, Quantity1, Quantity2, Quantity3, Quantity4, Quantity5
Table used for the update: QtyUpdate
Field Names-Location, Quantity
If a given location in the QtyUpdate.Location field falls in ProductData.Location2, then I need to subtract QtyUpdate.Quantity from the corresponding quantity field ProductData.Quantity2
My guess was to use an IIf statement something like this: IIf(([ProductData].[Location1] CONTAINS [QtyUpdate].[Location], [ProductData].[Quantity1]-[QtyUpdate].[Quantity])) Or IIf(([ProductData].[Location2] CONTAINS [QtyUpdate].[Location], [ProductData].[Quantity2] - [QtyUpdate].[Quantity].........etc.
Any help would be appreciated, thank you.