473,386 Members | 1,736 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,386 software developers and data experts.

Query:Null Values Screened Out

The database is located at this link:

http://www.angelfire.com/az/larrytucaz/tmp/db1.zip

This database has a query which sometimes screens to leave out "OCB" in the
last field in the query. It is joining the "documents" table with a
"revisions" table; the revisions is linked to documents by an id field.

I have noticed that if I don't give any criteria for the custom field, it
shows all values from "documents" table and the last revision number, even
if there isn't a related record(s) in the "revisions" table. However, if I
give the <>"OCB" (or any other) criteria in that last field, it not only
filters out those with OCB in the field but it ALSO filters out those which
don't have a related record in the "revisions" table.

Why is this? And how can one force it to show show, say, "N/A" as the value
in this field if there are no related records in the "revisions" table?

LRH

I noticed that when it does this, it also filters out those which have a
null value
Nov 12 '05 #1
2 5412
On Fri, 7 Nov 2003 22:59:00 -0700, Larry R Harrison Jr wrote:
...
I have noticed that if I don't give any criteria for the custom field, it
shows all values from "documents" table and the last revision number, even
if there isn't a related record(s) in the "revisions" table. However, if I
give the <>"OCB" (or any other) criteria in that last field, it not only
filters out those with OCB in the field but it ALSO filters out those which
don't have a related record in the "revisions" table. Why is this?
No idea what you mean. There are no OCB's in your DB. If you want to filter
you can include it in the sub query's WHERE clause.
And how can one force it to show show, say, "N/A" as the value
in this field if there are no related records in the "revisions" table?
LatestRevisionNumber: Nz((SELECT Max(ToRevision) FROM [Table of Revisions]
WHERE [Table of Revisions].DocID =[Table of Documents].DocID),"N/A")
I noticed that when it does this, it also filters out those which have a
null value


Correct. This won't happen with above line anymore.

HTH - Peter

--
No mails please.
Nov 12 '05 #2
Larry, that's how Null works. See:
The Query Lost My Records!
at:
http://members.iinet.net.au/~allenbrowne/casu-02.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Larry R Harrison Jr" <la*******@cox.net> wrote in message
news:FC%qb.4368$0K6.2351@fed1read06...
The database is located at this link:

http://www.angelfire.com/az/larrytucaz/tmp/db1.zip

This database has a query which sometimes screens to leave out "OCB" in the last field in the query. It is joining the "documents" table with a
"revisions" table; the revisions is linked to documents by an id field.

I have noticed that if I don't give any criteria for the custom field, it
shows all values from "documents" table and the last revision number, even
if there isn't a related record(s) in the "revisions" table. However, if I
give the <>"OCB" (or any other) criteria in that last field, it not only
filters out those with OCB in the field but it ALSO filters out those which don't have a related record in the "revisions" table.

Why is this? And how can one force it to show show, say, "N/A" as the value in this field if there are no related records in the "revisions" table?

LRH

I noticed that when it does this, it also filters out those which have a
null value

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Nick | last post by:
Im trying to build a graph of values from a counterTable. (Eg - get a list of how many times a page was requested in a week period with each y value being a day). If the table looks like...
3
by: I_was_here | last post by:
Hey if anyone is a query pro please showoff some knowledge thx. Ie: I have a table with : part price location qty 1 part repeats throughout the table and its price remains the same but it...
2
by: ralamo | last post by:
When i execute the following insert query, the above mentioned error is coming. Anything wrong in the query? INSERT INTO ECN_1 (Old_SbPartNo, Old_PartDesc, Old_ManPartNo, Old_Manuf,...
3
by: kathyburke40 | last post by:
Odd problem. I have a table in the following format: DocID Question1 Question2 Question3 ------------------------------------------------ 298 1, 2, 3 or 0 Each Question...
9
by: Kosmos | last post by:
I'm getting this error message: Number of query values and destination fields are not the same. This is the code: INSERT INTO tblDateDifference ( DateDifference ) SELECT tblContracts.EndDate...
2
by: cypriot | last post by:
Hi. I am developing an application program in java. I use MsAccess for keeping data. I had a problem with sql insert method. public void AddPatient() { String...
1
by: sshafer1 | last post by:
I have a form that is using query as the backend 'table'. I did this so that I could display query fields in my form that have been calculated. 1. How do I write those query field values to a...
2
by: Vince Morgan | last post by:
Hi all, I have a POST form that also includes some anchors/links. If a user clicks a link, that link remains set so that pressing the submit button later not only sends the appropriate POST value,...
3
by: monion | last post by:
One more question. How can I get query values assign them to a variable, but not show them? for example size, $f4 in the following: How can I pass that value $f4 to the form handle page to submit...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...

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.