
Signature
Regards
Jeff Boyce
<Office/Access MVP>
I apologize for leaving out vital info....my form is design to record all the
accidents that happens in our county. I have 3 fields that is missing data in
the query only. Injuires by department, injuries by employee and total
injuries. In the form I use the count function to get the results I need and
it works perfectly but in the query I am getting all 1. Here is my qry sql:
SELECT [tbl Employee Accidents].[EmployeeID#], [tbl Employee
Accidents].Name, [tbl Employee Accidents].Address, [tbl Employee
Accidents].City, [tbl Employee Accidents].ZipCode, [tbl Employee
Accidents].DOB, [tbl Employee Accidents].[Department:], [tbl Employee
Accidents].[Job Title:], [tbl Employee Accidents].[Location of Accident],
[tbl Employee Accidents].[Date of Injury:], [tbl Employee Accidents].[Time of
Injury:], [tbl Employee Accidents].[Date Employer Notified:], [tbl Employee
Accidents].[Type of Injury:], [tbl Employee Accidents].[Part of Body
Affected:], [tbl Employee Accidents].Summary, [tbl Employee Accidents].[No
Treatment], [tbl Employee Accidents].[Minor: By Employee], [tbl Employee
Accidents].[Minor: Clinic/ER], [tbl Employee Accidents].[Emergency Care],
[tbl Employee Accidents].[Hospitalized 24hrs], [tbl Employee
Accidents].[Hospital/Physician], [tbl Employee Accidents].[Hospital/Physician
Address], [tbl Employee Accidents].[Report Prepared By:], [tbl Employee
Accidents].Telephone, [tbl Employee Accidents].[Date Reported], Count([tbl
Employee Accidents].[Total Injuries by Department]) AS [CountOfTotal Injuries
by Department], Count([tbl Employee Accidents].[Total Injuries by Employee])
AS [CountOfTotal Injuries by Employee], Count([tbl Employee Accidents].[Total
Injuries:]) AS [CountOfTotal Injuries:], [tbl Employee
Accidents].[EmployeeID#]
FROM [tbl Employee Accidents]
GROUP BY [tbl Employee Accidents].[EmployeeID#], [tbl Employee
Accidents].Name, [tbl Employee Accidents].Address, [tbl Employee
Accidents].City, [tbl Employee Accidents].ZipCode, [tbl Employee
Accidents].DOB, [tbl Employee Accidents].[Department:], [tbl Employee
Accidents].[Job Title:], [tbl Employee Accidents].[Location of Accident],
[tbl Employee Accidents].[Date of Injury:], [tbl Employee Accidents].[Time of
Injury:], [tbl Employee Accidents].[Date Employer Notified:], [tbl Employee
Accidents].[Type of Injury:], [tbl Employee Accidents].[Part of Body
Affected:], [tbl Employee Accidents].Summary, [tbl Employee Accidents].[No
Treatment], [tbl Employee Accidents].[Minor: By Employee], [tbl Employee
Accidents].[Minor: Clinic/ER], [tbl Employee Accidents].[Emergency Care],
[tbl Employee Accidents].[Hospitalized 24hrs], [tbl Employee
Accidents].[Hospital/Physician], [tbl Employee Accidents].[Hospital/Physician
Address], [tbl Employee Accidents].[Report Prepared By:], [tbl Employee
Accidents].Telephone, [tbl Employee Accidents].[Date Reported], [tbl Employee
Accidents].[EmployeeID#];
I hope I gave enough information, thanks
LHEMA
> Without some idea of:
> > your data structure;
[quoted text clipped - 14 lines]
> > at this point, I have no clue of what I did wrong. Can someone please help
> me
Jeff Boyce - 08 Dec 2005 14:54 GMT
Have you tried working backwards on the query?

Signature
Regards
Jeff Boyce
<Office/Access MVP>
> I apologize for leaving out vital info....my form is design to record all the
> accidents that happens in our county. I have 3 fields that is missing data in
[quoted text clipped - 61 lines]
> > > at this point, I have no clue of what I did wrong. Can someone please help
> > me
LHEMA - 08 Dec 2005 15:01 GMT
what do you mean

Signature
LHEMA
> Have you tried working backwards on the query?
>
[quoted text clipped - 83 lines]
> help
> > > me
Jeff Boyce - 09 Dec 2005 01:51 GMT
Please see my earlier response.
If the query as is isn't working, take something out. Does it still (not)
work?
Take something more out. Does it work?
Keep going backwards until it works.
The other approach is to start over, with the minimum query. Then keep
adding back in pieces until it breaks. That helps you identify where/what
isn't working.

Signature
Regards
Jeff Boyce
<Office/Access MVP>
> what do you mean
>
[quoted text clipped - 85 lines]
> > help
> > > > me
LHEMA - 09 Dec 2005 12:41 GMT
I tried working backwards and all it does is effect my form and my report, I
have over 100 records and I do not wan to lose the information. I'll figure
something out. Thanks Jeff

Signature
LHEMA
> Please see my earlier response.
>
[quoted text clipped - 121 lines]
> > > help
> > > > > me
Jeff Boyce - 09 Dec 2005 12:57 GMT
Taking a query apart (or building one up) does not affect your underlying
records.
You have data (in tables), a query that returns records according to
selection criteria, and a form (and reports?) that use the query to display
selected records.
If your query isn't working correctly, you'll need to figure out why.
Have you tried creating a totally new query, to see if it does the same
thing that your old one does?

Signature
Regards
Jeff Boyce
<Office/Access MVP>
> I tried working backwards and all it does is effect my form and my report, I
> have over 100 records and I do not wan to lose the information. I'll figure
[quoted text clipped - 89 lines]
> > Employee
> > > > > Accidents].Telephone, [tbl Employee Accidents].[Date Reported],
[tbl
> > > > Employee
> > > > > Accidents].[EmployeeID#];
[quoted text clipped - 32 lines]
> > > > help
> > > > > > me
LHEMA - 09 Dec 2005 13:15 GMT
I am creating a new query now, I will let you know if it does the same.
Thanks, I'll keep you posted

Signature
LHEMA
> Taking a query apart (or building one up) does not affect your underlying
> records.
[quoted text clipped - 157 lines]
> > > > > help
> > > > > > > me