help with sql

  • Thread starter Thread starter John
  • Start date Start date
J

John

I keep getting enter parameter value for all the mods.whatever I tried
to enter a FROM paymenthist, mods but then I got a different error


UPDATE paymenthist2
SET paymenthist2.transdt = mods.dt
Where paymenthist2.transdt = '' AND paymenthist2.accountph =
mods.account and paymenthist2.col005 = mods.tramt;
 
What's the error? Without knowing it, my guess would be that
paymenthist2.transdt should be IS NULL rather than '', and you need some
sort of join or subselect in your Update so that you get a valid reference
to mods.tramt.

-Amy
 
When I do

UPDATE paymenthist2
SET paymenthist2.transdt = mods.dt
From paymenthist2, mods
Where paymenthist2.transdt IS NULL AND paymenthist2.accountph =
mods.account and paymenthist2.col005 = mods.tramt;

I get Syntax Error (missing Operator) in query expression 'mods.dt From
paymenthist2
 
You need to use SELECT to be able to use FROM. Why not just build the query
in the QBE and let access set everything up for you.

HTH;

Amy
 
Assuming that MODS is another table, you need to put a reference to it in your
update query. Possibly something like the following.

UPDATE paymenthist2 INNER JOIN Mods
ON paymenthist2.accountph = mods.account
and paymenthist2.col005 = mods.tramt
SET paymenthist2.transdt = mods.dt
Where paymenthist2.transdt = ''

And I suspect that the last line should be
WHERE paymenthist2.transdt is null
 
Back
Top