How to replace blank (null ) values with 0 for all records?

后端 未结 11 1579
情歌与酒
情歌与酒 2020-12-30 03:53

MS Access: How to replace blank (null ) values with 0 for all records?

I guess it has to be done using SQL. I can use Find and Replace to replace 0 with blank, but n

相关标签:
11条回答
  • 2020-12-30 04:25

    I just had this same problem, and I ended up finding the simplest solution which works for my needs. In the table properties, I set the default value to 0 for the fields that I don't want to show nulls. Super easy.

    0 讨论(0)
  • 2020-12-30 04:26

    without 'where's and 'if's ...

    Update Table Set MyField = Nz(MyField,0)
    
    0 讨论(0)
  • 2020-12-30 04:30
    UPDATE table SET column=0 WHERE column IS NULL
    
    0 讨论(0)
  • 2020-12-30 04:32

    The following Query also works and you won't need an update query if that's what you'd prefer:

    IIF(Column Is Null,0,Column)
    
    0 讨论(0)
  • 2020-12-30 04:36

    Go to the query designer window, switch to SQL mode, and try this:

    Update Table Set MyField = 0
    Where MyField Is Null; 
    
    0 讨论(0)
  • 2020-12-30 04:37
    UPDATE YourTable SET MyField = 0 WHERE MyField IS NULL
    

    works in most SQL dialects. I don't use Access, but that should get you started.

    0 讨论(0)
提交回复
热议问题