A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Report Sub-Total formulas where a value is null



 
 
Thread Tools Display Modes
  #1  
Old August 8th, 2007, 05:15 PM posted to microsoft.public.access.reports
Lydia[_2_]
external usenet poster
 
Posts: 7
Default Report Sub-Total formulas where a value is null

I have created a crosstab query in which some cells are null. There is
a report based on this query in which I want to create a field that
creates a sub-total for the row. As soon as the formula encounters an
empty field it returns a null result. What do I have to do to get the
formula to recognize the null as a zero?

For example

[Val1] [Val2] [Val3] Subtotal calculated

2 3 4 9
6 null 8 I want 14, I'm getting a null

I'm not having a problem creating the basic formula, I just don't know
how to account for the null values.

Lydia

  #2  
Old August 8th, 2007, 05:29 PM posted to microsoft.public.access.reports
John Spencer
external usenet poster
 
Posts: 7,815
Default Report Sub-Total formulas where a value is null

Nz is your friend - it changes nulls to 0 (or other specified value)

Nz(Val1,0) + Nz(Val2,0) + Nz(Val3,0)



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Lydia" wrote in message
ups.com...
I have created a crosstab query in which some cells are null. There is
a report based on this query in which I want to create a field that
creates a sub-total for the row. As soon as the formula encounters an
empty field it returns a null result. What do I have to do to get the
formula to recognize the null as a zero?

For example

[Val1] [Val2] [Val3] Subtotal calculated

2 3 4 9
6 null 8 I want 14, I'm getting a null

I'm not having a problem creating the basic formula, I just don't know
how to account for the null values.

Lydia



  #3  
Old August 8th, 2007, 07:46 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Report Sub-Total formulas where a value is null

If I understand correctly, you can create the "row" total in the crosstab
which would be more efficient than creating a complex expression in a control
source.

--
Duane Hookom
Microsoft Access MVP


"John Spencer" wrote:

Nz is your friend - it changes nulls to 0 (or other specified value)

Nz(Val1,0) + Nz(Val2,0) + Nz(Val3,0)



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Lydia" wrote in message
ups.com...
I have created a crosstab query in which some cells are null. There is
a report based on this query in which I want to create a field that
creates a sub-total for the row. As soon as the formula encounters an
empty field it returns a null result. What do I have to do to get the
formula to recognize the null as a zero?

For example

[Val1] [Val2] [Val3] Subtotal calculated

2 3 4 9
6 null 8 I want 14, I'm getting a null

I'm not having a problem creating the basic formula, I just don't know
how to account for the null values.

Lydia




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:30 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.