473,395 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Return only fields with values in a query

I have created a receipt table that gives one receipt number for each check received. On this table a customer can pay up to 12 invoices with one check. My problem I have ran into is, when I run a query I only want the fields (invoice #'s) with values (paid amount) in them to return. I don't need to see all 12 fields (Invoice #'s & their amounts) if the customer only paid for say 5.

I know there is a button to "show" checkbox for the fields. By not having the fields show, I could miss an invoice that a customer has paid for and obviously I don't want that.
Feb 7 '14 #1
4 1072
Rabbit
12,516 Expert Mod 8TB
You should have a separate invoice table with one record per invoice.
Feb 7 '14 #2
mcupito
294 256MB
In your query, for the Criteria or WHERE, "[PaidAmount] Is Not Null".

I know some people are against the use of "Null" however I think you could also put "[PaidAmount] > 0" also, going on the assumption people can't pay with $0.00

So, if your query currently brings back ALL records (invoices and paidamount), adding the Criteria on the PaidAmount should filter the records.

You could also use this to filter whether or not some one has NOT paid, by reversing the logic.
[PaidAmount] Is Null Or [PaidAmount] = 0

If you build your queries in Query Design, become familiar with the Criteria option.

Hope this helps.
Feb 7 '14 #3
NeoPa
32,556 Expert Mod 16PB
I'm afraid you cannot filter records that way and expect the results you want. If a record is included or not will affect all fields in the record equally. IE. You filter out records not fields.

This gets us back to Rabbit's comment. This may seem a little short and possibly unhelpful, but therein lies everything you need to help you get to a workable solution.

Your table design is not Normalised. Many people have discovered that databases designed that way always end up reaching a point where they become unusable for what's required. It's important to learn from others' experiences, so here's a link that will help (Database Normalisation and Table Structures).

Trying to continue with your current design will only lead to more and more things you may want to do but will be unable to, as in this case.
Feb 7 '14 #4
mcupito
294 256MB
@NeoPa, I overlooked his request of 'Fields.' Thanks for the correction.
Feb 7 '14 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Aaron | last post by:
can a method return multiple values? pseudo code public string method1() { //db pull select col1, col2, from tb1 s1 = col1;
16
by: Nikolay Petrov | last post by:
How can I return multiple values from a custom function? TIA
2
by: Cylix | last post by:
Can javascript using pointer or pass variable by reference? Or I need to using object or Array to return the two values? Thanks a lot.
1
by: v4u2chat | last post by:
Do I need to extend any of classes from AXIS to return multiple values? I'm exposing the following method as web service through AXIS to return multiple values. public ContactAddress...
2
by: MLH | last post by:
Have a data entry form bound to a table. Has a save button on it that launches DoCmd.RunCommand acCmdSaveRecord in Access 97. In the form after-update code, I have a line looking something like...
1
by: christianlott1 | last post by:
I used the code here: http://groups.google.com/group/comp.databases.ms-access/browse_thread/thread/4945db8db0321704/b918febe2ab9eda5?lnk=gst&q=list+fields++of+query&rnum=1&hl=en#b918febe2ab9eda5 ...
33
by: jayapal | last post by:
Hi all, Is there any way to return two values from a function .................... Thanks, jayapal
2
ADezii
by: ADezii | last post by:
The incentive for this Tip was an Article by the amazing Allen Browne - I considered it noteworthy enough to post as The Tip of the Week in this Access Forum. Original Article by Allen Browne ...
2
by: Ken Jones | last post by:
Table URL_3 consist of the following 2 columns of information being Record No and URL No URL 1 http:/publishing/45/100006_f.SAL_Local.html 2 ...
1
by: sumreen hassan | last post by:
how to show all null fields of query during run time? for example if one column of record is null all record is skiped please help me about this problem
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.