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

default value=0 in query? 2

Status
Not open for further replies.

hlkelly

Technical User
Jul 11, 2003
108
US
I have a query1 which generates totals of some fields from a table. I have query2 which generates totals from query1. There is a field, where if it is blank it leaves the field in null value. I need the field to be default "0" in order to complete the final computation. I have the default value in the table set to "0" but it doesn't carry through into my queries.

Make sense?

Heather
 
You can use the nz() function around the field in your query. If it finds a null, it returns a zero (or any other character you may need).

nz(FieldName,0).
 
I'm sorry...I'm not sure where to put this function. I tried a few places but I'm unfamiliar.

New to this stuff.

Thanks!
 
Replace this query field:

"...There is a field, where if it is blank it leaves the field in null value..."

with CalcField: nz([FieldName],0). In your second query, use the new CalcField for your sums.

You can also look the the problem query in sql view, copy the text, and post it to this forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top