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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding & Subtracting Numbers(Fields) with Expression Builder



 
 
Thread Tools Display Modes
  #1  
Old December 18th, 2006, 11:20 PM posted to microsoft.public.access.gettingstarted
Stuart
external usenet poster
 
Posts: 3
Default Adding & Subtracting Numbers(Fields) with Expression Builder

This has got to be simple but I don't see it. I have a simple query of a
table and I can see all the fields (defined as numbers in the table) in the
database. I simply want to add and subtract the fields to get a computed
value in the query. Currently the calculated column is always turns out
blank. (e.g.Expr1:
Alphy!Level-Alphy!Upright-Alphy!Chest-Alphy!Storeroom-Alphy!Kitchen or
simply an order amount equal to a desired level minus all on hand amounts in
the database) What is the exact syntax required for an computational
replacement in a query?

TIA, Stuart


  #2  
Old December 18th, 2006, 11:45 PM posted to microsoft.public.access.gettingstarted
fredg
external usenet poster
 
Posts: 4,386
Default Adding & Subtracting Numbers(Fields) with Expression Builder

On Mon, 18 Dec 2006 23:20:18 GMT, Stuart wrote:

This has got to be simple but I don't see it. I have a simple query of a
table and I can see all the fields (defined as numbers in the table) in the
database. I simply want to add and subtract the fields to get a computed
value in the query. Currently the calculated column is always turns out
blank. (e.g.Expr1:
Alphy!Level-Alphy!Upright-Alphy!Chest-Alphy!Storeroom-Alphy!Kitchen or
simply an order amount equal to a desired level minus all on hand amounts in
the database) What is the exact syntax required for an computational
replacement in a query?

TIA, Stuart


Use the dot, not the bang.
Alphy.Level

It's likely one of the fields is null.
Some value + Null = Null.
Use the Nz() function. Look it up in VBA help.

Expr1:Nz([Level],0) - Nz([Upright],0) - Nz([Chest],0) -
Nz([Storeroom],0) - Nz([Kitchen],0)

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old December 19th, 2006, 03:53 PM posted to microsoft.public.access.gettingstarted
Stuart
external usenet poster
 
Posts: 3
Default Adding & Subtracting Numbers(Fields) with Expression Builder

Thanks Fred. That fixed it.
Stuart//
"fredg" wrote in message
. ..
On Mon, 18 Dec 2006 23:20:18 GMT, Stuart wrote:

This has got to be simple but I don't see it. I have a simple query of a
table and I can see all the fields (defined as numbers in the table) in
the
database. I simply want to add and subtract the fields to get a computed
value in the query. Currently the calculated column is always turns out
blank. (e.g.Expr1:
Alphy!Level-Alphy!Upright-Alphy!Chest-Alphy!Storeroom-Alphy!Kitchen or
simply an order amount equal to a desired level minus all on hand amounts
in
the database) What is the exact syntax required for an computational
replacement in a query?

TIA, Stuart


Use the dot, not the bang.
Alphy.Level

It's likely one of the fields is null.
Some value + Null = Null.
Use the Nz() function. Look it up in VBA help.

Expr1:Nz([Level],0) - Nz([Upright],0) - Nz([Chest],0) -
Nz([Storeroom],0) - Nz([Kitchen],0)

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail



 




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 11:23 PM.


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