Hide 0 results in query (1 Viewer)

kenrav

New member
Local time
Today, 03:44
Joined
Jun 20, 2020
Messages
29
See attached query. Is there anyway to not show 0 QOH results?

Thanks!
 

Attachments

  • Query.jpg
    Query.jpg
    45.9 KB · Views: 71
  • Query Results.jpg
    Query Results.jpg
    16.8 KB · Views: 80

theDBguy

I’m here to help
Staff member
Local time
Today, 03:44
Joined
Oct 29, 2018
Messages
21,477
What happens if you add a criteria of <>0 under QOH?
 

kenrav

New member
Local time
Today, 03:44
Joined
Jun 20, 2020
Messages
29
What happens if you add a criteria of <>0 under QOH?
I'm sorry - I thought I had mentioned I tried that. My mistake. Yes, normally that would work. However, I just realized that my query is of a qryDef and I bet that's the problem. Thanks.
 

kenrav

New member
Local time
Today, 03:44
Joined
Jun 20, 2020
Messages
29
I'm sorry - I thought I had mentioned I tried that. My mistake. Yes, normally that would work. However, I just realized that my query is of a qryDef and I bet that's the problem. Thanks.
Yep! That was it.
 

plog

Banishment Pending
Local time
Today, 05:44
Joined
May 11, 2011
Messages
11,648
You shouldn't store credits ([Received]), and debits ([Dispensed]) in separate fields. The values they represent should go into the same field. Then you either use positive/negative numbers or a transaction type field to denote if credit or debit.
 

kenrav

New member
Local time
Today, 03:44
Joined
Jun 20, 2020
Messages
29
What's wrong with storing these values in separate fields?
 

plog

Banishment Pending
Local time
Today, 05:44
Joined
May 11, 2011
Messages
11,648
1. You are storing a piece of information not in the table, but in the field name (Received, Dispensed).

2. You want those values to work together. If the are in just one field, you simply SUM the column, the above method requires the addition of SUMmed values.

3. You're probably wasting space. I've seen others implement this using your current method and one record only holds day for Received or Dispensed, which means the other field is always blank. Which means one field is always not used in every record.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 11:44
Joined
Feb 19, 2013
Messages
16,619
think it is a matter of personal choice although I prefer the one column method. just less coding overall around data capture, reporting and interrogation. a null value (for numbers at any rate) takes up no space in storage,
 

kenrav

New member
Local time
Today, 03:44
Joined
Jun 20, 2020
Messages
29
1. You are storing a piece of information not in the table, but in the field name (Received, Dispensed).

2. You want those values to work together. If the are in just one field, you simply SUM the column, the above method requires the addition of SUMmed values.

3. You're probably wasting space. I've seen others implement this using your current method and one record only holds day for Received or Dispensed, which means the other field is always blank. Which means one field is always not used in every record.
Thank you for your advice. I'll keep this in mind going forward.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 06:44
Joined
Feb 19, 2002
Messages
43,302
Storing credits and debits as separate fields harks back to the days when accountants wore green eyeshades and did everything with pencil and paper and they didn't even have adding machines let alone computers. Keeping them separate in a computer system isn't wrong, it just complicates the internal processing. Do whatever your accountant wants.
 

Users who are viewing this thread

Top Bottom