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
Jeff Boyce - 26 Nov 2007 14:57 GMT
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.

Signature
Regards
Jeff Boyce
www.InformationFutures.net
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
> Folks,
> I've got a query that's something like :
[quoted text clipped - 7 lines]
> Many thanks
> Pete
John Spencer - 26 Nov 2007 16:45 GMT
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

Signature
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.
> Folks,
> I've got a query that's something like :
[quoted text clipped - 7 lines]
> Many thanks
> Pete