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

how to get zero for null fields in a query

Status
Not open for further replies.

rsmack

Programmer
Apr 7, 2007
5
US
i use a query to summarize transaction data from several tables for presentation in a form. if a table has no entries, because there are not yet any transactions of that type, the query returns null values for that table. these are unusable for calculations, such as totals. is there some way to get a zero value into these queries?
 
Maybe something like this:

Exp1:iif([Yourfield]is null,0,)

 
thank you lars7,

i can work this out one field at a time, but i have something like 8 fields for each of four quarters, as well as summaries of in and out transactions of multiple field payments for each of 13 customers, so i am looking for a global method to get zeroes into the queries, instead of having to resolve each field on a form.
 
Sorry rsmack, it doesn't work that way. You could change all your form or report controls to handle for the nulls I suppose, but your probably better off just doing it in your query, IMO.

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Use the Access NZ function e.g NZ([MynumberField],0) this converts the Null value to zero.
 
alexcuse,

how do i do i handle it in the query?

yont11,

thanks. i do know (now) how to do that. it does require a move for every field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top