Share via

update numeric field with Null value

Anonymous
2014-08-29T03:07:56+00:00

How can I update a numeric field with Null value if value is 0. I try the following but It does not work

UPDATE tblInternalIncident SET tblInternalIncident.LossValue = Null

WHERE tblInternalIncident.LossValue=0

Thks

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Duane Hookom 26,825 Reputation points Volunteer Moderator
    2014-08-29T15:33:03+00:00

    I created a table with a field to match yours and entered 0 into some of the records. I copied you SQL statement into a query SQL view and ran it. The results were exactly as expected. Any records with a 0 had the field values replaced with null.

    Are you sure the value is 0 in your records?

    What do you see with this query?

    SELECT tblInternalIncident.*

    FROM tblInternalIncident

    WHERE LossValue=0;

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-08-29T05:53:48+00:00

    I means I use the update query with that syntax, but when I run the query, nothing happen

    I am not sure if it allow Null. The field is not required to insert value, so I can leave it empty when inputting value. Is that the same meaning with "allow Null" ?

    Was this answer helpful?

    0 comments No comments
  3. Duane Hookom 26,825 Reputation points Volunteer Moderator
    2014-08-29T03:24:23+00:00

    What do you mean by "does not work"? Does the field allow Nulls?

    Was this answer helpful?

    0 comments No comments