>Hi guys! Hopefully quick question here.
>
>I have a table, we'll call it primary, and another called (you guessed it :) ) secondary. What I really want to do is:
>
>
>select primary
>replace approved with .f. for all encumb_id in ;
> (select encumb_id from secondary where noapp = .f.)
>
>
>But I seem to remember that I can't do a replace using an "in" or perhaps it was that you can't use the results of secondary select or something like that.
>
>I was figuring I'd just use a loop. I know that will work. But I wanted to doublecheck this understanding I have because I would have thought the SQL would be faster. That is, if I'm wrong and this can be done. So am I just missing something small or what?
>
Well, the problem is that REPLACE isn't using the SQL syntax. You could do a SQL UPDATE, though:
the template from Help:
UPDATE [DatabaseName1!]TableName1
SET Column_Name1 = eExpression1
[, Column_Name2 = eExpression2 ...]
WHERE FilterCondition1 [AND | OR FilterCondition2 ...]]
and a sample based on what you want to do:
UPDATE Primary ;
SET approved TO .F. ;
WHERE encumb_id IN ;
(SELECT encumb_id FROM secondary WHERE ! NoApp)
>Thanks in advance.