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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"nz,0"



 
 
Thread Tools Display Modes
  #1  
Old June 14th, 2004, 04:18 PM
Todd
external usenet poster
 
Posts: n/a
Default "nz,0"

I'm using Access 2.0. The query I'm writing requires the
sum of 2 fields. If I use the "nz,0" command to make sure
the fields add up even if one of the fields has a null
value, I can't sum the new field in a later query without
getting the message:

"The Microsoft Jet database engine could not execute the
SQL statement because it contains a field that has an
invalid data type."

Is there any way to add (+) 2 fields together, even if one
has some null values, and then later sum the new field-
using 2.0?

Thanks,
Todd
  #2  
Old June 14th, 2004, 08:10 PM
Duane Hookom
external usenet poster
 
Posts: n/a
Default "nz,0"

You may need to "wrap" your Nz() inside Val()
Val(Nz([YourField],0))


--
Duane Hookom
MS Access MVP
--

"Todd" wrote in message
...
I'm using Access 2.0. The query I'm writing requires the
sum of 2 fields. If I use the "nz,0" command to make sure
the fields add up even if one of the fields has a null
value, I can't sum the new field in a later query without
getting the message:

"The Microsoft Jet database engine could not execute the
SQL statement because it contains a field that has an
invalid data type."

Is there any way to add (+) 2 fields together, even if one
has some null values, and then later sum the new field-
using 2.0?

Thanks,
Todd



 




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 06:54 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.