Hello! Pls help me in this update query I have.

netbytes

Registered User.
Local time
Today, 11:15
Joined
Aug 11, 2008
Messages
33
Hi,

I have this update query.

UPDATE A INNER JOIN B ON (A.[field1] = B.field1) AND (A.field2 = B.field2)
B.field3 = B.[field3]+(B.[field3]-A.[field3]), B.field4 = B.[field4]+(B.[field3]-A.[field3]), B.field3 = A.[field3];


But I want it to execute after it satisfied this logical expression for each record in the A.field3 and B.field3.

Its like this.

IF A.field3 < B.field3 THEN execute the codes above.

Example:

Table A------------Table B

Field3--------------Field3
50-----------------100 >>>>>>>>>>>>> TRUE then EXECUTE the code.
100----------------20 >>>>>>>>>>>>>> FALSE then dont execute.
0------------------100 >>>>>>>>>>>>> TRUE then EXECUTE the code.
500----------------1000 >>>>>>>>>>>> TRUE then EXECUTE the code.
... -----------------.... and so on!

How to add a code that will execute the codes above in each record? Just one click then all will be updated.

Thank you,


Execute the Update Code...
 
What is your current SQL ? Does it just need the Where clause?

Brian
 
UPDATE Maurice_Closeout INNER JOIN MorningBite ON (Maurice_Closeout.[MSI Number] = MorningBite.vr_partno) AND (Maurice_Closeout.vendorID = MorningBite.vendor_id) SET MorningBite.customfield1 = IIf(Maurice_Closeout.[QUANTITY AVAILABLE]<=0,"OUT OF STOCK!",IIf(Maurice_Closeout.[QUANTITY AVAILABLE]>10,"IN STOCK!",IIf(Maurice_Closeout.[QUANTITY AVAILABLE]<=10,"LOW STOCK!","DISCONTINUED!"))), MorningBite.hideproduct = IIf(InStr(UCase(MorningBite.customfield1),"OUT OF STOCK"),"Y",IIf(InStr(UCase(MorningBite.customfield1),"DISCONTINUED"),"Y","N")), MorningBite.listprice = MorningBite.[listprice]+(MorningBite.[vendor_price]-Maurice.[COST PRICE]), MorningBite.productprice = MorningBite.[productprice]+(MorningBite.[vendor_price]-Maurice.[COST PRICE]), MorningBite.vendor_price = Maurice_Closeout.[COST PRICE], MorningBite.vr_price = Maurice_Closeout.[COST PRICE];

Actually this is the current update query I have.

anyway, i have an explanation in my previous post.

I want this to be executed in each record if this sample expression will be satistified: If A < B then execute the codes above.
 

Users who are viewing this thread

Back
Top Bottom