473,463 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Record Count mismatch in MS Access Database 2003

I am using MS Access Dataabse 2003. I have a table name Jan 2013 IPD Scanlist. This table has total records of 75 count. Now when I execute this query:

Expand|Select|Wrap|Line Numbers
  1. SELECT [IPD Scanlist January 2013].Discharge,
  2.    [IPD Scanlist January 2013].MRN,
  3.    [IPD Scanlist January 2013].[Last Name], 
  4.    [IPD Scanlist January 2013].[First Name], 
  5.    [IPD Scanlist January 2013].Admit, 
  6.    [IPD Scanlist January 2013].Therapist, 
  7.    [IPD Scanlist January 2013].[MTP present], 
  8.    [IPD Scanlist January 2013].[MTP Doctor], 
  9.    [IPD Scanlist January 2013].[MTP Therapist], 
  10.    [IPD Scanlist January 2013].[Sent For Scan], 
  11.    [IPD Scanlist January 2013].[Receipt of Scan], 
  12.    [IPD Scanlist January 2013].Notes, 
  13.    [IPD Scanlist January 2013].[MTP Nursing]
  14. FROM [IPD Scanlist January 2013]
  15. WHERE ((([IPD Scanlist January 2013].[MTP Therapist])=0)
  16.     AND
  17.       (([IPD Scanlist January 2013].[Receipt of Scan]) Is Null));
The total records is 14 ...

When I execute this query :
Expand|Select|Wrap|Line Numbers
  1. SELECT [IPD Scanlist January 2013].Discharge, 
  2.    [IPD Scanlist January 2013].MRN, 
  3.    [IPD Scanlist January 2013].[Last Name], 
  4.    [IPD Scanlist January 2013].[First Name], 
  5.    [IPD Scanlist January 2013].Admit, 
  6.    [IPD Scanlist January 2013].Therapist, 
  7.    [IPD Scanlist January 2013].[MTP present], 
  8.    [IPD Scanlist January 2013].[MTP Doctor], 
  9.    [IPD Scanlist January 2013].[MTP Therapist], 
  10.    [IPD Scanlist January 2013].[Sent For Scan], 
  11.    [IPD Scanlist January 2013].[Receipt of Scan], 
  12.    [IPD Scanlist January 2013].Notes, 
  13.    [IPD Scanlist January 2013].[MTP Nursing]
  14. FROM [IPD Scanlist January 2013]
  15. WHERE ((([IPD Scanlist January 2013].[MTP Doctor])=0) 
  16.    AND 
  17.       (([IPD Scanlist January 2013].[Receipt of Scan]) Is Null));
The total records is 18

When I execute this query:

Expand|Select|Wrap|Line Numbers
  1. SELECT [IPD Scanlist January 2013].Discharge, 
  2.    [IPD Scanlist January 2013].MRN, 
  3.    [IPD Scanlist January 2013].[Last Name], 
  4.    [IPD Scanlist January 2013].[First Name], 
  5.    [IPD Scanlist January 2013].Admit, 
  6.    [IPD Scanlist January 2013].Therapist, 
  7.    [IPD Scanlist January 2013].[MTP present], 
  8.    [IPD Scanlist January 2013].[MTP Doctor], 
  9.    [IPD Scanlist January 2013].[MTP Therapist], 
  10.    [IPD Scanlist January 2013].[Sent For Scan], 
  11.    [IPD Scanlist January 2013].[Receipt of Scan], 
  12.    [IPD Scanlist January 2013].Notes, 
  13.    [IPD Scanlist January 2013].[MTP Nursing]
  14. FROM [IPD Scanlist January 2013]
  15. WHERE ((([IPD Scanlist January 2013].[Receipt of Scan]) Is Null) 
  16.    AND 
  17.       (([IPD Scanlist January 2013].[MTP Nursing])=0));
The total record is 29.

Now when I add all these records 14+18+29=61 where the total records for entire table is 75. So this is where I am facing the problem.

Please Help.
Jan 24 '13 #1
4 1725
zmbd
5,501 Expert Mod 4TB
Not to state the obvious; however, it would be be logical to assume that your queries lack the correct overlap/bounding to retreve the entire dataset using the parameters.

It also appears that your database may not be normalized given the names of the fields. You may want to take a look at my two favorite links for this:
A Tutorial for Access

Database Normalization and Table Structures.
Jan 24 '13 #2
Thanks a lot. I will consider your input and see how it works.
Jan 24 '13 #3
Rabbit
12,516 Expert Mod 8TB
You have no count of not null records. Otherwise, what's the point of having a column that will always be null? You also do not account for those fields where the value is not 0. And you do not account for those where multiple fields can be 0.
Jan 24 '13 #4
NeoPa
32,556 Expert Mod 16PB
All records where [Receipt of Scan] is other than Null will be excluded from all your queries.
Any records which have a zero in more than one of the listed fields ([MTP Therapist]; [MTP Doctor]; [MTP Nursing]) will be counted more than once.
Any records which have non-zero values in all of those fields from the previous list will not be counted.

I would be very surprised (from the information you have shared in the question) if the numbers you quote had any logical connection at all with each other.
Jan 24 '13 #5

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

Similar topics

12
by: Wadim Grasza | last post by:
I want to store and display (on a form or a report) multiple pictures per record in an access database. The pictures are not stored within the database. They are stored as files and the database...
4
by: authorking | last post by:
I use the following code to insert a data record in to a datatable of an access database.But every time I execute the command, there will rise an exception and the insert operation can't be...
5
by: nicholas | last post by:
I would like to insert a new record in a Ms Access database and retrieve the newly created ID (autonumber). I would like to do it in VB.NET for an ASP.NET page. ( no asp) I found several...
3
by: Phi | last post by:
Hi, I hope somebody could help me with this problem. I would like to make a form to add and delete records from my ms access database. I've found most of the codes from the internet and...
6
by: Bob Alston | last post by:
I am looking for others who have built systems to scan documents, index them and then make them accessible from an Access database. My environment is a nonprofit with about 20-25 case workers who...
3
by: mysore | last post by:
Hello, I have several textboxes on my VB6.0 form.I am using textboxes one for each field. I have Placed adocontrol on my form to connect to MS access database. The connectivity is fine. I...
2
by: ravindarjobs | last post by:
hello friends, i have a table named "Technology" it has few columns. of them two are 1.Name 2. Type
1
by: kklodhi2008 | last post by:
Hello, I have created a table named as "SLA_tracking_sheet" in access and created a form SLA_tracking_form using the same table then I made another form as "First" in which I am adding a textbox...
4
by: shalskedar | last post by:
The Compact & Repair option is not working on 1 of the computers .The Operating system used is Windows XP. In the Database,when the Compact & Repair option is used it creates a separate file as...
2
by: George Yar | last post by:
Re: How to show changes in open Access 2003 Table in VB I have a form to add a new record to my Access Database table. This is a code: Private Sub btnAdd_Click() Dim dbExpenses As...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.