Nz function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table that I designed (not in the most effective manor). I have
several fields which will be null in each record. I set the default value to
zero so that my calculations would work in my queries. My user has told me
that the zeros are distracting and she wants me to get rid of them. I posted
a message and was told to use the Nz function everywhere my possibly null
vaule fields will show up. I was told to wrap the field name Balance like
this
Nz(Balance,0)

I tried the following statement in my QBE
TotalITA:
NZ[ITA(Tuition),0)]+Nz[ITA(Books),0]+Nz[ITA(ClassSupplies),0)]+Nz[ITA(OtherSupplies),0]

It did not work.
Where do I need to put this function in order to get it to work?
 
Close, the syntax just needs a little work. Is ITA a table name or a
function?

If ITA is a table name:
Nz([ITA].[Tuition],0)+Nz([ITA].[Books],0)+Nz([ITA].[ClassSupplies],0)+Nz([ITA].[OtherSupplies],0)

If ITA is a function and the function needs 0 passed to it instead of Null:
ITA(Nz([Tuition],0))+ITA(Nz([Books],0))+ITA(Nz([ClassSupplies],0))+ITA(Nz([OtherSupplies],0))
 
I have a table that I designed (not in the most effective manor). I have
several fields which will be null in each record. I set the default value to
zero so that my calculations would work in my queries. My user has told me
that the zeros are distracting and she wants me to get rid of them. I posted
a message and was told to use the Nz function everywhere my possibly null
vaule fields will show up. I was told to wrap the field name Balance like
this
Nz(Balance,0)

I tried the following statement in my QBE
TotalITA:
NZ[ITA(Tuition),0)]+Nz[ITA(Books),0]+Nz[ITA(ClassSupplies),0)]+Nz[ITA(OtherSupplies),0]

It did not work.
Where do I need to put this function in order to get it to work?
first look up the help for NZ()

if you would have done it, you would write
TotalITA:
Nz([MyTable].[MyField1];)+Nz([MyTable][MyField2];0)........

exchange:
MyTable with your tbale name (if you have only one table in your
query you can skip it)
MyFieldx with your fieldnames
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top