Simple SQL (MS Access...) question
People here know SQL, right? Right?
Alright, so I'm simply trying to update all null entries in ColumnA of TableA with the largest value found in ColumnB of TableB. What do. This is what Access auto-generates. PHP Code:
Quote:
|
Re: Simple SQL (MS Access...) question
I have no fucking idea of the MS Access SQL dialect, and I'm not really sure I understand what you're looking for, but from a bit of reading the reference, try something like this (backup first!):
Code:
UPDATE TableA SET TableA.ColumnA = (SELECT Max(TableB.ColumnB) FROM TableB) |
Re: Simple SQL (MS Access...) question
I don't know if that would cause the error, but you don't need any of the parenthesis around "TableA.ColumnA IS Null". I've worked with MS SQL lately and I've noticed it's a bit different to MySQL with where it requires parenthesis.
|
Re: Simple SQL (MS Access...) question
Code:
UPDATE TableA SET ColumnA = (SELECT MAX(ColumnB) FROM TableB) WHERE ColumnA IS NULL; |
Re: Simple SQL (MS Access...) question
Access returned an astoundingly unhelpful error message when I tried the above suggestion(s). The way I ended up having to accomplish this was incredibly asinine and convoluted, taking several hours to tackle. It involves macros, hidden named calculated fields on forms that only exist for this purpose, and a total of three queries.
Thanks for the help dudes. I certainly know more about SQL after taking this Access course, but I never want to use this god damn program ever again. |
Re: Simple SQL (MS Access...) question
Good! Use a real SQL database! :P
|
All times are GMT -4. The time now is 06:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.