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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SQL: IsNull, SUM over columns and COUNT 3
Iif/IsNull Question 6
IsNull 2
Using ISNULL() 17
Nested IIf and IsNull 1
circular reference 3
SQL: IsNull, SUM over columns and COUNT 3
IIF IsNull in a SQL not working. 3

Back
Top