Gunnar Peipman's ASP.NET blog

ASP.NET, C#, SharePoint, SQL Server and general software development topics.






Nz() function

NB! This blog is moved to

Nz() function is kinky creature is Access VBA. It is called “null to zero” but it hardly has something to do with zeros. For me this function is good shortcut for gangsta rapper street name – NullZ. Well, for me was most confusing the fact that one need to provide this function with null’s replacement value if empty string is not enough for numbers.

After this assigment:

i = Nz(Rs("Size"))

the value of i is empty string. If we want Nz() to return zero, we need to write it this way:

i = Nz(Rs("Size"), 0)

I have to say that Nz() was very memory freshing experience after long time without any VBA code. :)


Brian said:

Wow, you should be ASP.NET MVP...

# April 13, 2009 4:40 PM

DigiMortal said:

Ou yes... It was pretty long time ago when I wrote VBA applications too. Currently I some rare times have to deal with them. As you may understand then being ASP.NET MVP doesn't mean ASP.NET-ing all the software in the world. :)

# April 13, 2009 5:07 PM