Nz function from .NET

P

pbaugh

Folks,
I've got a query that's something like :
SELECT Nz(Materials.MaterialCost, 0) FROM Materials

This works fine in Access but when I call from my .NET app, it
complains of "Unknown function Nz"

Any ideas on how I might rectify this??

Many thanks
Pete
 
J

Jeff Boyce

I don't know enough about .NET to tell you which function in .NET is
equivalent to the Null-to-Zero function in Access. Since you are working in
..NET, you'd probably need to use a function .NET knows.

Or, I'll guess you could just create a query in Access that returns what
you've written below, then call the QUERY as a data source from .NET.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
J

John Spencer

Try using the immediate IIF function instead.

SELECT IIF(MaterialCost is Null,0,MaterialCost) FROM Materials


NZ is a VBA function. IIF is available in jet sql
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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

Top