update query

  • Thread starter Thread starter Dsikirica
  • Start date Start date
D

Dsikirica

I have a record that compares 2 years and the fields are
for example 0103 0203 0303 0104 0204 0304 etc. I only
want to update if the prior year has a value greater than
0. for example if 0103 > 0 then i want the amount to go
to 0104. I have two tables joined by id and month year
but the query doesn't take an iif statement in the update
field in design view. iif ( 0103>0, invamt,0) Is this
possible?
 
I have a record that compares 2 years and the fields are
for example 0103 0203 0303 0104 0204 0304 etc. I only
want to update if the prior year has a value greater than
0. for example if 0103 > 0 then i want the amount to go
to 0104. I have two tables joined by id and month year
but the query doesn't take an iif statement in the update
field in design view. iif ( 0103>0, invamt,0) Is this
possible?

You're using spreadsheet logic. Access IS NOT A SPREADSHEET.

Storing data in fieldnames - years and months in this case - is
*extremely bad design* and will cause you lots and lots of trouble. In
particular, a Join connects two tables by linking the *value in a
primary key field* to *the value in a foreign key field* - not by
linking to a fieldname.

Stop, step back, and consider "normalizing" your data. If you work
with Access as it is designed, rather than treating it as a "big
version of Excel", you'll have a much easier time!
 
Back
Top