INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

NZ Function in query?

NZ Function in query?

(OP)
I have a query with the following fields: "InsPayment" and "Fee"
I want to have a calculated field named Adjustment. The Adjustment should calculate what to 'write-off' only after insurance pays their portion of the fee.
This is what I have for the Adjustment field: Adjustment: [fee]-[InsPayment]
So, if there is a fee of $50 and the insurance has not paid anything; As this is written, the Adjustment field returns the full fee as the write-off.
I do not want this to calculate unless there is an actual amount put in the inspayment column
What do I add to the formula to obtain this result?
As usual thank you so much for those out there helping those of us that are in need of advice!

RE: NZ Function in query?

I think you only need to use:

CODE --> query

Adjustment: [fee]-Nz([InsPayment],0) 

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: NZ Function in query?

(OP)
Thanks Duane,
I tried your suggestion and it is not returning the results I want. This is what it is returning:
Example 1: Fee: $50.00 Insurance Payment: 0 Adjustment: $50
Example 2: Fee: $50.00 Insurance Payment: 10 Adjustment: $40

Example 1: Result should be Adjustment 0 - since insurance has not yet paid any amount.
Example 2: Result is ok, because insurance payment has been received.

RE: NZ Function in query?

Adjustment: [fee]-Nz([InsPayment],[Fee])

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: NZ Function in query?

If [InsPayment] is nothing or empty then Nz will work, if 0 - no. If the value is 0, use iif function instead.

combo

RE: NZ Function in query?

0 is an amount and Null is not an amount.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: NZ Function in query?

(OP)
Thanks Duane!
It works exactly as needed!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close