iif statment in update query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

what is the proper sintax for including an iff criteria when adding stuff
through an update query. The information i wish to update is a caluculation
of a table, but i only wish to add this information if my criteria is met.

Please provide an example if possible

Thanks so much!!
 
i wish to update a table of names from a previously contruscted table of
rates, objects and names. But i only want to match the rates with the name if
the number of objects (from my original table) meets my requirments.
 
From your description it is presumed that the table of names contains the
same names as the previous table. Create a query that includes both tables.
Join the Names filed in both tables. Pull down the rate field from the table
of names and the objects field from the previous table. Enter an expression
for the criteria of the Objects field that defines your requirements. Change
the query to an Update Query. Enter TblPrevious.Rate where it says update to
under the rate field.
 
PC Datasheet said:
Create a query that includes both tables.
Join the Names filed in both tables. Pull down the
<<mouse clicks description snipped>>

It is extremely unlikely a wizard/designer will generate 'proper'
syntax as requested by the OP <g>.

The required syntax could be:

UPDATE MyTable
SET MyCol =
IFF(<...>)
;

However, I suspect they want something more like this:

UPDATE MyTable
SET MyCol = (<sub query>)
WHERE EXISTS (<sub query>)
;

If the OP posts some sample data plus expected results, we could pit
human against machine and see which generates the 'proper' syntax.

Jamie.

--
 
Back
Top