update query

  • Thread starter Thread starter alecgreen
  • Start date Start date
A

alecgreen

Hi

I want an update query, that deducts 20% from the value of a field
[SOH], assuming that [SOH] is greater than zero. I also need the
resulting figure to be a whole number. ie not ending in 0.25 or 0.5
etc.

Any help would be greatly appreciated.

Many Thanks

Alec
 
UPDATE tblCurrency
SET tblCurrency.SOH = Int([SOH]*0.8)
WHERE tblCurrency.SOH >0 ;
 
Hi

I want an update query, that deducts 20% from the value of a field
[SOH], assuming that [SOH] is greater than zero. I also need the
resulting figure to be a whole number. ie not ending in 0.25 or 0.5
etc.

Any help would be greatly appreciated.

Many Thanks

Alec

UPDATE mytable
SET [SOH] = Fix(0.8 * [SOH])
WHERE [SOH] > 0;

Deducting 20% from 0 will give 0 so the criterion isn't needed, but there's no
point in running a "do nothing" update.
 
Back
Top