


In one condition you have:
... WHERE FILE1.CTRY = 'US'
That part seems direct enough. There shouldn't be any need for anything beyond that for the first condition.
For the other condition, I assume that this would produce a result set of all CLIENTs that met that condition:
SELECT file2.CLIENT FROM [LIBRARY2]File2 WHERE File2.VATNO =NULL
If that's true, then a basic subselect might be sufficient:
Update [LIBRARY1]FILE1 SET CATCDE='EXM' where FILE1.CTRY = 'US' and
file1.CLIENT in(SELECT file2.CLIENT FROM [LIBRARY2]File2 WHERE File2.VATNO =NULL
If that works and if it performs good enough, that should be all there is to it. I would first try something like this:
SELECT file1.CLIENT, file1.CATCDE FROM [LIBRARY1]FILE1 where FILE1.CTRY = 'US' and
file1.CLIENT in(SELECT file2.CLIENT FROM [LIBRARY2]File2 WHERE File2.VATNO =NULL
The output should let you do a visual review to see if all CLIENTs that needed to be included were there and that no CLIENT was missing that should be included.
Once you can make the SELECT work, you can feel more secure with the UPDATE. Anything like a performance problem can be worked out after correct selection is accomplished.
Tom


OK Have got this working:
For Some Reason NULL and NOT NULL are not working so I’m using <> and =” to get it selecting the right records.
What if I wanted Multiple Countries? I.E. the Eurozone?
etc. or
I’m fairly new to SQL I’m used to query’s rather than statements.
What if I wanted Multiple Countries? I.E. the Eurozone?
You can use something like:
etc. or
You can also use something like:
Tom
Cool Thanks; The Select Statement is working. Now for the Update: :S
Regards
Dan.