ISPrincess
Programmer
You have been such GREAT help to me -
Again, I am not sure how to find the answer to this in the forum but here is my problem, simply stated:
I have Location Records such as:
Location = A
NewQty = 100
OldQty = 95
Diff = 5
For this location in another Table I have multiple Pallets, such as:
Pallet = 1
Qty = 25
Pallet = 2
Qty = 25
Pallet = 3
Qty = 20
Pallet = 4
Qty = 25
In the most basic sense I need to be able to retieve the Pallet number with the least quantity (3) in order to increase that pallets quantity by the difference (5).
I have done this on a one by one basis but would like to be able to handle this all in one fell swoop for many records.
If you want to take a look at my existing but not working query - it follows:
Thank you so much for any help (again...) PH
I was walking home one night and a guy hammering on a roof called me a paranoid little weirdo.
In morse code.
-Emo Phillips
Again, I am not sure how to find the answer to this in the forum but here is my problem, simply stated:
I have Location Records such as:
Location = A
NewQty = 100
OldQty = 95
Diff = 5
For this location in another Table I have multiple Pallets, such as:
Pallet = 1
Qty = 25
Pallet = 2
Qty = 25
Pallet = 3
Qty = 20
Pallet = 4
Qty = 25
In the most basic sense I need to be able to retieve the Pallet number with the least quantity (3) in order to increase that pallets quantity by the difference (5).
I have done this on a one by one basis but would like to be able to handle this all in one fell swoop for many records.
If you want to take a look at my existing but not working query - it follows:
Code:
INSERT LPHa
Select
TransCode as TransStatus,
'Qty Increase' as TransMessage,
PalletID,
Quantity,
Location
From LPHp LPH
Join Inv INV
On INV.RFLocation = LPH.CurrentLocation
Where INV.TransCode = '50001'
And LPH.PalletID IN
(Select top 1
LPH2.LicensePlateno
From LPHp LPH2
where LPH2.Location = INV.RFLocation
Order by Quantity, LPH2.PalletID)
Thank you so much for any help (again...) PH
I was walking home one night and a guy hammering on a roof called me a paranoid little weirdo.
In morse code.
-Emo Phillips