Why is my query not returning all of the results?

  • Thread starter Thread starter Bayou BoB
  • Start date Start date
B

Bayou BoB

Hello There!

I have a small form that allows our users to input their time spent
and on what activity. The structure is small...and is as such:

tblProgActivity
MedActivityID (Primary Key)
ClientID
ActDate
EmployeeID
ActivityID
TimeID

The form is a series of combo boxes that allows the user to select
from the multitude of options (all in their own seperate tables) that
exist, in order to make the appropriate entry at any given time. It
works just fine....and all of the fields are required with the
exception of the ClientID field because some activities don't involve
a client.

I created a query for this in order to tie everything together, so
that the data is usable to create reports. When the query is run, it
does show all of the data pulled in from the other tables. The only
problem is that it leaves out any row in the table above, that has an
empty clientID entry. What did I miss doing? Many thanks.

Kevin
 
Bayou BoB said:
Hello There!

I have a small form that allows our users to input their time spent
and on what activity. The structure is small...and is as such:

tblProgActivity
MedActivityID (Primary Key)
ClientID
ActDate
EmployeeID
ActivityID
TimeID

The form is a series of combo boxes that allows the user to select
from the multitude of options (all in their own seperate tables) that
exist, in order to make the appropriate entry at any given time. It
works just fine....and all of the fields are required with the
exception of the ClientID field because some activities don't involve
a client.

I created a query for this in order to tie everything together, so
that the data is usable to create reports. When the query is run, it
does show all of the data pulled in from the other tables. The only
problem is that it leaves out any row in the table above, that has an
empty clientID entry. What did I miss doing? Many thanks.

Impossible to say since you didn't post your query. Are you joining or
filtering on the clientID field?
 
Your query likely contains expression
INNER JOIN tblClients ON
tblProgActivity.ClientID=tblClients.ClientID,

Make it
LEFT JOIN tblClients ON
tblProgActivity.ClientID=tblClients.ClientID

and you will get your records, even the ones where there
is no ClientID in the tblProgActivity

:-)
For more help, please use
Dejan*Mladenovic@EQAO*com
with . instead *
 
Back
Top