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

Null fields

I have an Access 2000 database that has a table 'tblCourse' and a
table 'tblRegistration'.

They are linked via a Primary key 'CourseID' in 'tblCourse' to a
foreign key 'CourseID' in the tblRegistration, this is a one to many
relationship. The Primary key in the tblRegistration is
RegistrationID.

When I construct a query that has 'CourseID' and then e.g.
"CountRegistrationID:
IIf(IsNull(Count([tblRegistration].[RegistrationID]),0,
Count([tblRegistration].[RegistrationID]))" as the two fields, it will
not include the courses that have no registrations in them.

What I am wanting to obtain is a list of 'all' the courses including
the ones that don't have any registrations in them.

Do you have any ideas as to how to do this, or is it not possible?

Frustrated.
Nov 12 '05 #1
4 3569
Perhaps I am missing something, but can't you count the Courses in
tblCourse? It'd seem to me to be awfully difficult to count
non-registrations in the Registration table, unless you preallocate a record
per seat in each class or something.

Larry Linson
Microsoft Access MVP
"Craig" <cw*********@centacarebrisbane.net.au> wrote in message
news:62**************************@posting.google.c om...
I have an Access 2000 database that has a table 'tblCourse' and a
table 'tblRegistration'.

They are linked via a Primary key 'CourseID' in 'tblCourse' to a
foreign key 'CourseID' in the tblRegistration, this is a one to many
relationship. The Primary key in the tblRegistration is
RegistrationID.

When I construct a query that has 'CourseID' and then e.g.
"CountRegistrationID:
IIf(IsNull(Count([tblRegistration].[RegistrationID]),0,
Count([tblRegistration].[RegistrationID]))" as the two fields, it will
not include the courses that have no registrations in them.

What I am wanting to obtain is a list of 'all' the courses including
the ones that don't have any registrations in them.

Do you have any ideas as to how to do this, or is it not possible?

Frustrated.

Nov 12 '05 #2
I am wanting to count the number of registrations against the course and
need to indicate to people if the course has 0 or more participants
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
"Craig Williamson" <cw*********@centacarebrisbane.net.au> wrote in message
news:3f*********************@news.frii.net...
I am wanting to count the number of registrations against the course and
need to indicate to people if the course has 0 or more participants


What kind of join are you using between the tables? It needs to be an outer
join. In the query design window it would have an arrow pointing towards the
table that might not have matching records. Double-click the line to change it.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #4
How about a Totals Query, grouped by Course, joined with a Query of the
Course table, "all records from Course and only those that match from the
Totals Query", and a calculated field of NZ(CountOfRegistrations)?

Larry Linson
Microsoft Access MVP

"Craig Williamson" <cw*********@centacarebrisbane.net.au> wrote in message
news:3f*********************@news.frii.net...
I am wanting to count the number of registrations against the course and
need to indicate to people if the course has 0 or more participants
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #5

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

Similar topics

1
by: yutlin | last post by:
Hello, Could anyone tell me if it is possible to bind a null value to a statement? I.E. $stmt->bind_param('isd',$var1,$var2,$var3); $var1 = (something indicating null); $var2 = (something...
2
by: Joel | last post by:
Hi, I added a field to my company table (PBV_rstCompany.Fields("Installer")) the default value of the field is Null. I place this If statement and it doesn't work If...
6
by: AAVF | last post by:
Hi We have a problem with a query. An Access database links via ODBC to a UNIX server. To speed things, we use the ODBC to load the relevant tables to the local PC that runs Access so that...
1
by: allyn44 | last post by:
Hello, I have a table that has null fields that need to be filled in with the value of the previous record (example below) id date 1 2/2/02 2 3 4/4/02 4
3
by: JOEP | last post by:
What do I need to do to allow an append query to post null values to records in a field of the destination table? Basically I want to allow records with null values to post to the table. The append...
1
by: RiesbeckP | last post by:
Hi All, I have a DB where there are customer numbers and a few other fields. I want to be able to pull all of the null records for a particular field as well as all the other customer numbers...
7
by: Dan | last post by:
I'm fairly new to C# and I am having some problems understanding int variables and null values. I have created a class that populates the values of it's fields from a DataReader in it's...
2
by: Brett | last post by:
My database has 2 tables: Table1 & Table2. If a field is not null on a record in table2, then the not null fields in table1 that correspond to the records in table1 needs to be updated to match the...
4
by: Debbiedo | last post by:
I searched the groups and tried several approaches but still cannot find a solution. I have a table that has several hundred fields that may or may not need to be displayed in a report,...
10
by: Toby Gallier | last post by:
Hello! I have a form that is calculating averages as follows: " =(NZ()+Nz()+Nz())/3 " However I need to now adjust for null values , so for example if value2 is null I would then need to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.