Jump to content

comparing and adding rows to a table


ruffneck
 Share

Recommended Posts

ok here is my problemi have 2 tablesprijsupdateartikelnummer, crediteurnummer, Extern_nummer, Brutoprijs(this is an empty column)levprijsExtern_nummer, Brutoprijsi want to compare Extern_nummer from prijsupdate with levprijs Extern_nummer if levprijs Externnummer = prijsupdate Extern_nummer then it needs to write levprijs Brutoprijs into prijsupdate Brutoprijs at the right Extern_nummer from prijsupdateso far i got thisUPDATE prijsupdateSET prijsupdate.Brutoprijs= (SELECT levprijs.BrutoprijsFROM levprijsWHERE prijsupdate.Extern_nummer= levprijs.Extern_nummer )but i keep getting stuck with this errorthe proces needs to run on a query that can be adjusted.if i put inUPDATE prijsupdateSET prijsupdate.Brutoprijs= (SELECT levprijs.BrutoprijsFROM levprijsWHERE prijsupdate.Extern_nummer= levprijs.Extern_nummer.pk )i need to fill in numbers each row or something, but i just want him to add all records matching without me needing to do anything, because we r talking like 250000 records here :)if someone can help me with this or tell me what to do it would be greatly appreciated

Link to comment
Share on other sites

I dont know what to say dude, I just tested the query I gave you yesterday,

UPDATE prijsupdateSET prijsupdate.Brutoprijs = (SELECT levprijs.BrutoprijsFROM levprijsWHERE prijsupdate.Extern_nummer = levprijs.Extern_nummer )

And it work perfectly... i dont know why it doesnt work for you, but it should...

Link to comment
Share on other sites

I dont know what to say dude, I just tested the query I gave you yesterday,
UPDATE prijsupdateSET prijsupdate.Brutoprijs = (SELECT levprijs.BrutoprijsFROM levprijsWHERE prijsupdate.Extern_nummer = levprijs.Extern_nummer )

And it work perfectly... i dont know why it doesnt work for you, but it should...

well i donno why it didn't work either i keep getting stuck with this error the proces needs to run on a query that can be adjusted. if i now save the query and run it i get a box where i can fill in the numbers 1 by 1 so they get added 1 by 1does it have anything to do with maybe field relations or primairy keys or something
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...