Update Query Help!

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

Guest

Good day,

I have an update query in which I'm trying to transfer data from one field
(PrevYrsLt) to another (LtPts) based on if the data in PrevYrsLt is > 0 ,
then LtPts will take the value of PrevYrsLt. I was using:

Field: LtPts
Table: tblCptTest
Update to: PrevYrsLt
Criteria: PrevYrsLt > 0

but i keep getting data type mismatch or a conversion error.

Any help would be greatly appreciated

TIA
-Paul
 
I have an update query in which I'm trying to transfer data from one field
(PrevYrsLt) to another (LtPts) based on if the data in PrevYrsLt is > 0 ,
then LtPts will take the value of PrevYrsLt. I was using:

Field: LtPts
Table: tblCptTest
Update to: PrevYrsLt
Criteria: PrevYrsLt > 0

but i keep getting data type mismatch or a conversion error.
Hi Paul,

I believe you just need to include PrevYrsLt
in another column of your grid, then set *its*
Criteria row to >0.

Field: LtPts PrevYrsLt
Table: tblCptTest tblCptTest
Update to: PrevYrsLt
Criteria: > 0

PrevYrsLt > 0 is a condition that evaluates
to True or False....and LtPts is not a Boolean
field...it won't be True or False...so you get
a type mismatch error.

Your SQL view should look like:

Update tblCptTest
Set LtPts = PrevYrsLt
WHERE PrevYrsLt > 0;

A successful strategy for designing update
queries "early-on" is to create a select query first,
applying criteria, and checking that the
select query returns the records you want
to update...then, change it to an update query
and fill in the Update to: rows for the field(s)
to be updated.

Please respond back if I have misunderstood
or was not clear about something.

Good luck,

Gary Walter
 
Back
Top