If isnull

  • Thread starter Thread starter Louise
  • Start date Start date
L

Louise

In MS SQL Server I can write this query

select isnull (convert( varchar(20),sum(Folkmangd)),'a')
from....

To get the result 'a' when the field is null.

How can I get the same in Access?

Louise
 
Dear Louise:

There is a function Nz() you can use, with the same syntax as
isnull().

For the convert() you can use CStr() (convert to string). I think you
would not need this.

Nz(SUM(Folkmangd), "a")

This may be enough.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Dear Tom,

Thank you for the reply. It works fine when I try it in MS
Access, but I need to use it in a old C program with ODBC
APIs and a data source with ms access driver.

When I try it there I get the error message "undefined
function 'Nz'

Is there anyway to get around this?

Louise
 
Dear Louise:

It is certainly true you will not be able to use the native Access
functions within a Jet query unless you are doing so from within
Access.

You could install MSDE and make the Jet table accessible as a Linked
Server, then use the SQL Server syntax and functionality with which
you seem already to be familiar.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Back
Top