Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO equivalent to Nz() Function?

Status
Not open for further replies.

eAlchemist

Technical User
Aug 28, 2003
64
0
0
US
Anyone know if if there is an ADO equivalent to the Nz() funtion in Access. I have queries that work in Access that I reference through ADO, and they're not working. Anyone have any advice? I know I can use an IIF(IsNull([VALUE]),0,[VALUE]), but I'm hoping there is an easier way.

Thanks,
Chris
 
I don't know if this will work in ADO, but SQL Server has the IsNull function:

ISNULL ( check_expression , replacement_value )

 
ADO is not the mechanism that parses and runs SQL statements. That's the function of the specific DBMS that you are using. That's why "NZ" (for example) runs in an SQL statement submitted to Access but doesn't run when submitted to SQL Server or Oracle.

You need to look at the underlying DBMS to find out what built in functions it supports.
 
coalesce(field1,field2, field3,default_value)
(Coalesce will return the first field in the list that is NOT NULL)

will be standard across many DB's. But as Golom said you need to know what DB you are using in order to determine the correct one to use.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top