Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Microsoft Access

Status
Not open for further replies.

ashley420

Programmer
Oct 21, 2003
1
0
0
US
How do you convert null value to zero?
 
There are many ways but the easiest is to use the Nz function.
 
Dim myInteger as Integer

msgbox Nz(MyInteger)
msgbox Nz(MyInteger,0)

Nz takes 2 arguments, the second being optional. The first is your variable/expression.

Nz returns the input var/expression if it is not null, and retuns 0 otherwise (or the value specified in the second argument).

Nz(Name, "John Doe")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top