Results 1 to 5 of 5
  1. #1
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481

    Is it possible to have this report from this structure?


    Hey

    Can some help out to generate this report "Attached BCSR file" from the data structure "attached Rows into Columns1 file".

    the code for query is here.

    Code:
    SELECT tblBodyComp.TrnNo, "B" & [BodyNo] AS [Body No], tblBodyComp.CompDate, tblBodyComp.ProductGroup, tblBodyComp.ProdDate, tblBodyComp.Purpose, tblBodyComp.ApprovedBy, tblBodyComp.Note, tblBodyCompR.RawMaterial, tblBodyCompR.[Composition%]
    FROM tblBodyComp INNER JOIN tblBodyCompR ON tblBodyComp.TrnNo = tblBodyCompR.TrnNo;
    the productgroup and aprrovedby are multiple values fields from table level combo box lookup fields.


    thanks a lot.

    zee

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    See these
    https://www.accessforums.net/reports...html#post99062
    http://allenbrowne.com/func-concat.html

    I expect will require several queries to get the desired output. Provide data and will take a look.
    Last edited by June7; 01-20-2012 at 01:12 AM.
    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.

  3. #3
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Hello Sir, how are you.

    can you look at this thread and i am sure you can add some of your expertise.


    https://www.accessforums.net/queries...ata-21056.html

    thanks

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    I have examined your data and the report sample you show probably cannot be done by queries alone. Will require code as demonstrated by the example in http://forums.aspfree.com/microsoft-...ry-322123.html

    This series of queries will get some of it.

    Query1
    SELECT tblBodyComp.TrnNo, "B" & [BodyNo] AS [Body No], tblBodyComp.CompDate, tblBodyComp.ProductGroup, tblBodyComp.ProdDate, tblBodyComp.Purpose, tblBodyComp.ApprovedBy, tblBodyComp.Note, tblBodyCompR.RawMaterial, tblBodyCompR.[Composition%]
    FROM tblBodyComp RIGHT JOIN tblBodyCompR ON tblBodyComp.TrnNo = tblBodyCompR.TrnNo;

    Query!_Crosstab
    TRANSFORM Sum(Query1.[Composition%]) AS [SumOfComposition%]
    SELECT Query1.RawMaterial
    FROM Query1
    GROUP BY Query1.RawMaterial
    PIVOT Query1.[Body No];

    Query2
    SELECT tblItem.ShortName, Query1_Crosstab.*
    FROM Query1_Crosstab RIGHT JOIN tblItem ON Query1_Crosstab.RawMaterial = tblItem.ItemID;
    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.

  5. #5
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Hello Sir,

    Thanks for your time.

    what do you think about this?

    TRANSFORM Sum(Query1.[Composition%]) AS [SumOfComposition%]
    SELECT Query1.CompDate, Query1.[Body No]
    FROM Query1
    GROUP BY Query1.CompDate, Query1.[Body No]
    PIVOT Query1.RawMaterial;

    which is give more details as the date of composition but when we RawMaterials as column heading so only code is appearing instead of shortname?

    - how to use multiple fields in a cross tab query?

    thanks

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

Similar Threads

  1. How to structure my db?
    By JeredG in forum Access
    Replies: 5
    Last Post: 11-14-2011, 06:22 PM
  2. BD Structure (review)
    By Bryan021 in forum Database Design
    Replies: 0
    Last Post: 05-26-2011, 11:39 AM
  3. Hierachy Structure
    By anandram in forum Database Design
    Replies: 11
    Last Post: 05-02-2011, 12:20 PM
  4. Help with Database Structure
    By scottay in forum Access
    Replies: 8
    Last Post: 06-30-2010, 08:16 AM
  5. SQL statment structure
    By oss_ma in forum Programming
    Replies: 1
    Last Post: 05-13-2007, 02:08 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