Results 1 to 2 of 2
  1. #1
    mejia.j88 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Location
    california
    Posts
    228

    combining records to show as one in a report.

    i was wondering what the easiest/most efficient/etc way of combining records in a report.

    i have attached a pdf of the report i run. If we look under Second Shift, part number X25UFG, there are 2 entries that are the same: 160 start quantity and 157 end quantity, along with the same Glassing Lot and same Glass Batch. those are two distinct records but i would rather display them as a whole.

    i would want start qty to be 320 and end qty to be 314. i DONT want to sum up all of the records with the same glass lot and glass batch, but rather those that are identical all across the report.



    below is the SQL for the query that feeds my report.

    Code:
    SELECT CDate(Format([Date_Time],"mm/dd/yyyy")) AS ShiftDate, Glassing_Yield.PN, Switch(TimeValue([glassing_yield].[Date_Time]) Between TimeSerial(0,0,0) And TimeSerial(5,0,0),"3rd Shift",TimeValue([glassing_yield].[Date_Time]) Between TimeSerial(5,30,0) And TimeSerial(14,0,0),"1st Shift ",TimeValue([glassing_yield].[Date_Time]) Between TimeSerial(14,0,0) And TimeSerial(22,0,0),"2nd Shift",TimeValue([glassing_yield].[Date_Time]) Between TimeSerial(22,0,0) And TimeSerial(0,0,0),"3rd Shift") AS WorkShift, [Start_Qty]-[End_Qty] AS [Reject Qty], [End_Qty]/[Start_Qty] AS [Reject Pct], Glassing_Yield.Start_Qty, Glassing_Yield.End_Qty, Glassing_Yield.Date_Time, QRY_opt_report_query.Evaporation_Lot, QRY_opt_report_query.Diffusion_Lot, Glassing_Yield.Operator, Glassing_Yield.Glassing_Lot, Glassing_Yield.Batch_No, Glassing_Yield.WO, Glassing_Yield.Glassing_MachineFROM QRY_opt_report_query INNER JOIN Glassing_Yield ON QRY_opt_report_query.work_order = Glassing_Yield.WO
    WHERE (((Glassing_Yield.Date_Time) Is Not Null))
    GROUP BY CDate(Format([Date_Time],"mm/dd/yyyy")), Glassing_Yield.PN, Switch(TimeValue([glassing_yield].[Date_Time]) Between TimeSerial(0,0,0) And TimeSerial(5,0,0),"3rd Shift",TimeValue([glassing_yield].[Date_Time]) Between TimeSerial(5,30,0) And TimeSerial(14,0,0),"1st Shift ",TimeValue([glassing_yield].[Date_Time]) Between TimeSerial(14,0,0) And TimeSerial(22,0,0),"2nd Shift",TimeValue([glassing_yield].[Date_Time]) Between TimeSerial(22,0,0) And TimeSerial(0,0,0),"3rd Shift"), [Start_Qty]-[End_Qty], [End_Qty]/[Start_Qty], Glassing_Yield.Start_Qty, Glassing_Yield.End_Qty, Glassing_Yield.Date_Time, QRY_opt_report_query.Evaporation_Lot, QRY_opt_report_query.Diffusion_Lot, Glassing_Yield.Operator, Glassing_Yield.Glassing_Lot, Glassing_Yield.Batch_No, Glassing_Yield.WO, Glassing_Yield.Glassing_Machine
    HAVING (((CDate(Format([Date_Time],"mm/dd/yyyy"))) Between [Forms]![frmShiftYieldByDateRange]![txtStartDate] And [Forms]![frmShiftYieldByDateRange]![txtEndDate]) AND ((Glassing_Yield.Start_Qty)<>0))
    ORDER BY CDate(Format([Date_Time],"mm/dd/yyyy")) DESC;
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    The query is a GROUP BY, so what is keeping these two records separate? If they really do have identical data, the GROUP BY should aggregate them into one.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Combining Records
    By admessing in forum Queries
    Replies: 2
    Last Post: 12-15-2011, 05:41 PM
  2. Help with Combining multiple Records
    By Jennivere in forum Queries
    Replies: 1
    Last Post: 11-28-2011, 08:05 PM
  3. Query for combining records
    By alpinegroove in forum Queries
    Replies: 6
    Last Post: 01-28-2011, 07:29 AM
  4. show 4 records in each report page
    By kareem_h in forum Reports
    Replies: 5
    Last Post: 11-10-2010, 10:11 PM
  5. combining field from two records into one
    By RedGoneWILD in forum Queries
    Replies: 8
    Last Post: 07-13-2010, 09:47 AM

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