Results 1 to 8 of 8
  1. #1
    haV3rhill is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2018
    Posts
    4

    Report not pulling data correctly


    I have a problem with one of my reports not pulling data correctly. There is a form I use to manually enter data, and the data that has been entered through the form does not match what comes out on my report. It seems that it is only allowing two entries per date, and as long as I am only entering two entries per date the report pulls fine and will capture every audit that has been entered, but if all the entries are from the same date or if I have more than two entries for the same date, the report only pulls data for two of the entries. What can I do to make sure my report pulls data correctly from all audits entered?

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The first thing you need to do is get the query working, the one which you are using as the record source for the report. The report only displays what is in the query. So, create a query, show us samples of what the data looks like going in and what you would like it to look like afterwards.

  3. #3
    haV3rhill is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2018
    Posts
    4
    This is what my report looks like. as you can see it is only picking up two audit entries.
    Click image for larger version. 

Name:	Capture14.JPG 
Views:	8 
Size:	40.5 KB 
ID:	32394

    I actually have five audit entries that were entered on the same date as shown below.
    Click image for larger version. 

Name:	Capture15.JPG 
Views:	8 
Size:	29.8 KB 
ID:	32395

    Here is the query that the report is pulling from.
    Click image for larger version. 

Name:	Capture16.JPG 
Views:	8 
Size:	49.1 KB 
ID:	32396

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Where is the problem occurring? So far you have shown us two queries - which one is not producing the correct results? Are there any more queries? Like I said, get the queries working, start from the beginning and see which query is dropping the data.

  5. #5
    haV3rhill is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2018
    Posts
    4
    So this is what I just sent.
    Click image for larger version. 

Name:	Capture17.JPG 
Views:	5 
Size:	68.2 KB 
ID:	32401

    and when I go into the table and change the dates manually so that there are only two entries for one date, the report pulls correctly and recognizes all audit entries. See report below compared to the first one I sent.

    Click image for larger version. 

Name:	Capture18.JPG 
Views:	5 
Size:	30.5 KB 
ID:	32402

    Click image for larger version. 

Name:	Capture19.JPG 
Views:	5 
Size:	37.6 KB 
ID:	32403

    It seems to have something to do with the date cell for some reason.

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    I am only interested in the queries - not the tables, not the report, no matter how many times you show them!

  7. #7
    haV3rhill is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2018
    Posts
    4
    QUERY 1
    SELECT tbl_ZapResult.ZapResult_HazardID, tbl_ZapResult.ZapResult_HazardValue, tbl_Hazards.[Hazard_Name/Description], tbl_HazardCategory.HazCat_Name, tbl_Supervisor.Supervisor_Name
    FROM tbl_Supervisor INNER JOIN ((tbl_ZAP_Observation INNER JOIN tbl_ZapResult ON tbl_ZAP_Observation.[Zap_ID] = tbl_ZapResult.[ZapResult_ZapID]) INNER JOIN (tbl_HazardCategory INNER JOIN tbl_Hazards ON tbl_HazardCategory.HazCat_ID = tbl_Hazards.Hazard_HazCat_ID) ON tbl_ZapResult.[ZapResult_HazardID] = tbl_Hazards.Hazard_ID) ON tbl_Supervisor.Supervisor_Id = tbl_ZAP_Observation.[Zap_SupervisorID]
    GROUP BY tbl_ZapResult.ZapResult_HazardID, tbl_ZapResult.ZapResult_HazardValue, tbl_Hazards.[Hazard_Name/Description], tbl_HazardCategory.HazCat_Name, tbl_Supervisor.Supervisor_Name, tbl_ZAP_Observation.Zap_Date
    HAVING (((tbl_ZAP_Observation.Zap_Date) Between [forms]![frm_mainboard]![txt_startdate] And [forms]![frm_mainboard]![txt_enddate]));

    QUERY 2
    SELECT qry_HazDRangUnsafe.ZapResult_HazardID, qry_HazDRangUnsafe.[Hazard_Name/Description], qry_HazDRangUnsafe.HazCat_Name, Sum(IIf([ZapResult_HazardValue]=0,1,0)) AS Safe, Sum(IIf([ZapResult_HazardValue]=-1,1,0)) AS Unsafe
    FROM qry_HazDRangUnsafe
    GROUP BY qry_HazDRangUnsafe.ZapResult_HazardID, qry_HazDRangUnsafe.[Hazard_Name/Description], qry_HazDRangUnsafe.HazCat_Name;

    QUERY 3
    SELECT qry_HazDRangUnsafe.ZapResult_HazardID, qry_HazDRangUnsafe.[Hazard_Name/Description], qry_HazDRangUnsafe.HazCat_Name, Sum(IIf(qry_HazDRangUnsafe.[ZapResult_HazardValue]=0,1,0)) AS Safe, Sum(IIf(qry_HazDRangUnsafe.[ZapResult_HazardValue]=-1,1,0)) AS Unsafe, qry_HazDRangUnsafe.Supervisor_Name
    FROM qry_HazDRangUnsafe
    GROUP BY qry_HazDRangUnsafe.ZapResult_HazardID, qry_HazDRangUnsafe.[Hazard_Name/Description], qry_HazDRangUnsafe.HazCat_Name, qry_HazDRangUnsafe.Supervisor_Name
    HAVING (((qry_HazDRangUnsafe.HazCat_Name) Not Like "*SAI*"));

    QUERY 4
    SELECT Count(qry_zapsDrange.Zap_ID) AS CountOfZAP_ID, qry_zapsDrange.Supervisor_Name, qry_zapsDrange.Zap_Class
    FROM qry_zapsDrange
    GROUP BY qry_zapsDrange.Supervisor_Name, qry_zapsDrange.Zap_Class;

    QUERY 5
    SELECT Count(qry_zapsDrange.[ZAP_ID]) AS CountOfZAP_ID, qry_zapsDrange.Supervisor_Name
    FROM qry_zapsDrange
    GROUP BY qry_zapsDrange.Supervisor_Name;

    QUERY 6
    SELECT tbl_ZAP_Observation.ZAP_ID, tbl_ZAP_Observation.ZAP_Date, tbl_Supervisor.Supervisor_Name, tbl_ZAP_Observation.ZAP_Class
    FROM tbl_Supervisor INNER JOIN tbl_ZAP_Observation ON tbl_Supervisor.Supervisor_Id = tbl_ZAP_Observation.[ZAP_SupervisorID]
    GROUP BY tbl_ZAP_Observation.ZAP_ID, tbl_ZAP_Observation.ZAP_Date, tbl_Supervisor.Supervisor_Name, tbl_ZAP_Observation.ZAP_Class
    HAVING (((tbl_ZAP_Observation.ZAP_Date) Between [forms]![frm_mainboard]![txt_startdate] And [forms]![frm_mainboard]![txt_enddate]));

  8. #8
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Which query is showing all the records correctly, and which is not?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Report not pulling in all data
    By bennyamy in forum Access
    Replies: 6
    Last Post: 03-06-2017, 10:30 AM
  2. Replies: 5
    Last Post: 04-17-2015, 11:04 AM
  3. Replies: 5
    Last Post: 12-27-2012, 02:54 PM
  4. Replies: 5
    Last Post: 06-13-2012, 09:34 AM
  5. Reports not pulling data correctly
    By yes sir in forum Access
    Replies: 13
    Last Post: 04-01-2011, 09:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums