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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return of "Error" in a query

Status
Not open for further replies.

SKing44

Technical User
Dec 2, 2001
8
GB
I hope sombody can help with this.....
My database runs a report which looks for records, counts them and the assigns a value depending on the type of data returned. My problem is that if there are no returned records, my query gives the result of "Error", How do I get a return of "0" or another value from a query if there are no records ?

Thanks ;-)
 
Use the nz function. Straight from Help...

You can use the Nz function to return zero, a zero-length string (" "), or another specified value when a Variant is Null. For example, you can use this function to convert a Null value to another value and prevent it from propagating through an expression.

Syntax

Nz(variant[, valueifnull])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top