NZ function not recognised

elliotgr

Registered User.
Local time
Today, 18:02
Joined
Dec 30, 2010
Messages
67
I am running Access 2007 opening a 2003 database. The Nz function is not working in a normal select query. In fact Access does not recognise it as it stays in lower case. Am I missing a reference or is there some other setting?
 
Answered my own question. It can only be used if the other grouped fields are also not null.
I was doing a count of the date and trying to show the date, but when the date is null, Nz appears not to work.
 
Nz() works on any data type although IsDate() is preferred for dates.

Nz(yourfield, returnWhenNull) The Nz() function has default "returnWhenNull" values for numbers (0) and strings (""). I don't know if there is a specific default for dates or what it might be. If anything, it would be 0 which equates to Dec 30, 1899.

When integral Access functions don't seem to work, the problem is usually a missing reference. Open any code module, then tools/references. Fix any missing references and compile. Fix any compile errors.
 

Users who are viewing this thread

Back
Top Bottom