dbTalk Databases Forums  

A2K - How to exclude records with zero values

comp.databases.ms-access comp.databases.ms-access


Discuss A2K - How to exclude records with zero values in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
buckskin
 
Posts: n/a

Default A2K - How to exclude records with zero values - 02-03-2011 , 03:53 PM






I've got a simple select query as the basis of a report with multiple
currency fields and a few text fields.
If all of the currency fields are zero I would like to exclude them from the
report. There are 17 currency fields.

How can I amend the query to exclude those empty rows?

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: A2K - How to exclude records with zero values - 02-03-2011 , 06:10 PM






buckskin wrote:

Quote:
I've got a simple select query as the basis of a report with multiple
currency fields and a few text fields.
If all of the currency fields are zero I would like to exclude them from the
report. There are 17 currency fields.

How can I amend the query to exclude those empty rows?

Well, you could have a calced field in your query. Ex:
TotCur : [Field1] + [Field2] + [Field3]....

And in the criteria have
<> 0

I think that should work.

Reply With Quote
  #3  
Old   
buckskin
 
Posts: n/a

Default Re: A2K - How to exclude records with zero values - 02-03-2011 , 06:38 PM



"Salad" <salad (AT) oilandvinegar (DOT) com> wrote

Quote:
buckskin wrote:

I've got a simple select query as the basis of a report with multiple
currency fields and a few text fields.
If all of the currency fields are zero I would like to exclude them from
the
report. There are 17 currency fields.

How can I amend the query to exclude those empty rows?


Well, you could have a calced field in your query. Ex:
TotCur : [Field1] + [Field2] + [Field3]....

And in the criteria have
0

I think that should work.

Oooh, that's clever. Thanks.

Reply With Quote
  #4  
Old   
Salad
 
Posts: n/a

Default Re: A2K - How to exclude records with zero values - 02-03-2011 , 08:51 PM



buckskin wrote:

Quote:
"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news:X6GdnTxvurtB3tbQnZ2dnUVZ_sadnZ2d (AT) earthlink (DOT) com...

buckskin wrote:


I've got a simple select query as the basis of a report with multiple
currency fields and a few text fields.
If all of the currency fields are zero I would like to exclude them from

the

report. There are 17 currency fields.

How can I amend the query to exclude those empty rows?


Well, you could have a calced field in your query. Ex:
TotCur : [Field1] + [Field2] + [Field3]....

And in the criteria have
0

I think that should work.



Oooh, that's clever. Thanks.


It'd be a pita writing the expression for 17 fields.

You're welcome.

Reply With Quote
  #5  
Old   
buckskin
 
Posts: n/a

Default Re: A2K - How to exclude records with zero values - 02-03-2011 , 09:47 PM



"Salad" <salad (AT) oilandvinegar (DOT) com> wrote

Quote:
buckskin wrote:

"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news:X6GdnTxvurtB3tbQnZ2dnUVZ_sadnZ2d (AT) earthlink (DOT) com...

buckskin wrote:


I've got a simple select query as the basis of a report with multiple
currency fields and a few text fields.
If all of the currency fields are zero I would like to exclude them
from

the

report. There are 17 currency fields.

How can I amend the query to exclude those empty rows?


Well, you could have a calced field in your query. Ex:
TotCur : [Field1] + [Field2] + [Field3]....

And in the criteria have
0

I think that should work.



Oooh, that's clever. Thanks.


It'd be a pita writing the expression for 17 fields.

You're welcome.
Indeed! Just got it working. Super sweet.

Reply With Quote
  #6  
Old   
Salad
 
Posts: n/a

Default Re: A2K - How to exclude records with zero values - 02-03-2011 , 10:08 PM



buckskin wrote:

Quote:
"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news:nbydnToSZ7ko9NbQnZ2dnUVZ_vidnZ2d (AT) earthlink (DOT) com...

buckskin wrote:


"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news:X6GdnTxvurtB3tbQnZ2dnUVZ_sadnZ2d (AT) earthlink (DOT) com...


buckskin wrote:



I've got a simple select query as the basis of a report with multiple
currency fields and a few text fields.
If all of the currency fields are zero I would like to exclude them

from

the


report. There are 17 currency fields.

How can I amend the query to exclude those empty rows?


Well, you could have a calced field in your query. Ex:
TotCur : [Field1] + [Field2] + [Field3]....

And in the criteria have
0

I think that should work.



Oooh, that's clever. Thanks.



It'd be a pita writing the expression for 17 fields.

You're welcome.


Indeed! Just got it working. Super sweet.

Uhhhh...potential problem. If there are negative numbers there is a
possibility that adding up numbers could equal zero. Adding Abs()
around each field in the expression would solve that if negatives are
possible. Or a humoungous criteria statement with ORs would work as well.

Reply With Quote
  #7  
Old   
buckskin
 
Posts: n/a

Default Re: A2K - How to exclude records with zero values - 02-03-2011 , 10:34 PM



"Salad" <salad (AT) oilandvinegar (DOT) com> wrote

Quote:
buckskin wrote:

"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news:nbydnToSZ7ko9NbQnZ2dnUVZ_vidnZ2d (AT) earthlink (DOT) com...

buckskin wrote:


"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news:X6GdnTxvurtB3tbQnZ2dnUVZ_sadnZ2d (AT) earthlink (DOT) com...


buckskin wrote:



I've got a simple select query as the basis of a report with multiple
currency fields and a few text fields.
If all of the currency fields are zero I would like to exclude them

from

the


report. There are 17 currency fields.

How can I amend the query to exclude those empty rows?


Well, you could have a calced field in your query. Ex:
TotCur : [Field1] + [Field2] + [Field3]....

And in the criteria have
0

I think that should work.



Oooh, that's clever. Thanks.



It'd be a pita writing the expression for 17 fields.

You're welcome.


Indeed! Just got it working. Super sweet.


Uhhhh...potential problem. If there are negative numbers there is a
possibility that adding up numbers could equal zero. Adding Abs()
around each field in the expression would solve that if negatives are
possible. Or a humoungous criteria statement with ORs would work as well.

Yes negatives can and will happen. I don't know what Abs() is but will
lookup.

I was playing with criteria but at some point you can't go to the next
field - did I run out of them? i.e there's a limit to the criteria you can
specify in Access 2000?

Reply With Quote
  #8  
Old   
Salad
 
Posts: n/a

Default Re: A2K - How to exclude records with zero values - 02-03-2011 , 11:01 PM



buckskin wrote:

Quote:
"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news4WdncbrB5wx5tbQnZ2dnUVZ_oidnZ2d (AT) earthlink (DOT) com...

buckskin wrote:


"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news:nbydnToSZ7ko9NbQnZ2dnUVZ_vidnZ2d (AT) earthlink (DOT) com...


buckskin wrote:



"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news:X6GdnTxvurtB3tbQnZ2dnUVZ_sadnZ2d (AT) earthlink (DOT) com...



buckskin wrote:




I've got a simple select query as the basis of a report with multiple
currency fields and a few text fields.
If all of the currency fields are zero I would like to exclude them

from


the



report. There are 17 currency fields.

How can I amend the query to exclude those empty rows?


Well, you could have a calced field in your query. Ex:
TotCur : [Field1] + [Field2] + [Field3]....

And in the criteria have
0

I think that should work.


*
Oooh, that's clever. Thanks.



It'd be a pita writing the expression for 17 fields.

You're welcome.


Indeed! Just got it working. Super sweet.


Uhhhh...potential problem. If there are negative numbers there is a
possibility that adding up numbers could equal zero. Adding Abs()
around each field in the expression would solve that if negatives are
possible. Or a humoungous criteria statement with ORs would work as well.



Yes negatives can and will happen. I don't know what Abs() is but will
lookup.

Abs makes a number positive whether or not the number is positive or
negative. Thus Abs(3) + Abs(-1) + Abs(-2) would be 6, not zero.

Quote:
I was playing with criteria but at some point you can't go to the next
field - did I run out of them? i.e there's a limit to the criteria you can
specify in Access 2000?

That I would not know. I suppose you could ViewSQL and write in the
code lines and see if it works if you can't specify it in from the
designer window.

Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.