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

Value adding problems 1

Status
Not open for further replies.
Jan 27, 2004
63
CA
I am trying to add values of fields in access.
My problem is as follows; One field value contains a value greater than zero, and the other fields value comes to zero.

When I add the two and multiply then by 6/12, the whole answer comes out to be a zero which is not correct.

Below is what I am using in my build part.

2002: [PC_Summary].[2001 Quantity]*[Percent_leased]![2001]+[PC_Summary].[2002 Quantity]*[Percent_leased]![2002]*(6/12)

2001 = 9
2002 = 0
*6/12

A whole number is supposed to come out while I am getting z null value.

Any help would be very helpful.
 
Try:

2002: (([PC_Summary].[2001 Quantity]*[Percent_leased]![2001])+([PC_Summary].[2002 Quantity]*[Percent_leased]![2002]))*(6/12)


HTH
Mike

[noevil]
 
never mind I finally figured it out. It was all related to useing the NZ function.

Thanks anyways for helping.

Later
 
Hi Poweruser99,

Are you getting zero, or are you getting null?

If any elements which go to build up the expression are null, then the whole expression will evaluate to null. I don't know which of your 2002 fields might be null, but try ..

[blue]2002: [PC_Summary].[2001 Quantity]*[Percent_leased]![2001]+[highlight]Nz([/highlight][PC_Summary].[2002 Quantity]*[Percent_leased]![2002][highlight])[/highlight]*(6/12)[/blue]

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top