Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / July 2007

Tip: Looking for answers? Try searching our database.

Exoression in Query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pete Rothery - 27 Jul 2007 20:02 GMT
I have a crosstab query wich produces 3 columns of numbers - thats ok.
Then I get a select query using the crosstab query as source and multply
each of the 3 vaues by a different factor using expressions - thats ok too.

Then, in a 4th colum I add the three values, it works if all 3 values are
non-zero but not if any one of them is zero - just get a blank cell.

Any help or advice gratefully received

Pete
Douglas J. Steele - 27 Jul 2007 20:10 GMT
Is it really a zero field, or is it if any of the fields don't have a value?

Try using the Nz function: rather than

[Field1] + [Field2] + [Field3]

use

Nz([Field1],0) + Nz([Field2],0) + Nz([Field3], 0)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I have a crosstab query wich produces 3 columns of numbers - thats ok.
> Then I get a select query using the crosstab query as source and multply
[quoted text clipped - 7 lines]
>
> Pete
Pete Rothery - 27 Jul 2007 20:44 GMT
Thanks Douglas - worked 1st time

> Is it really a zero field, or is it if any of the fields don't have a value?
>
[quoted text clipped - 17 lines]
> >
> > Pete
Kerry - 27 Jul 2007 20:12 GMT
Use the Nz function.

For example
Nz([Field1],0)+Nz([Field2],0)+Nz([Field3],0) AS Expr1

(I used 0 as the value if Null, since that is the additive identity).

On Jul 27, 3:02 pm, Pete Rothery
<PeteRoth...@discussions.microsoft.com> wrote:
> I have a crosstab query wich produces 3 columns of numbers - thats ok.
> Then I get a select query using the crosstab query as source and multply
[quoted text clipped - 6 lines]
>
> Pete
Pete Rothery - 27 Jul 2007 20:44 GMT
Thanks Kerry - worked 1st time

> Use the Nz function.
>
[quoted text clipped - 15 lines]
> >
> > Pete
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.