Results 1 to 11 of 11
  1. #1
    lalit81 is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2020
    Posts
    7

    Get multiple data against records

    I am having the table where data with the same invoice number stored as shown in table 2 and I would like to display it as shown in table2
    invoiceno amnt month
    123 77 jan
    453 89 feb
    123 65 april
    321 34 jan
    321 44 feb
    453 87 mar
    321 45 may

    invoice amnt1 amnt2 amnt3
    123 77 65


    321 34 44 45
    453 89 87

    I used the pivot table query but didnt worked can someone please help me

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    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
    lalit81 is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2020
    Posts
    7
    Hi There
    This quite doesnt work in my case i checked tried and tested .I am not able to get desired output

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Last edited by Welshgasman; 01-27-2024 at 10:25 AM.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    WGM, I think you posted a link to this very thread? This seems to be thread 89286.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by Micron View Post
    WGM, I think you posted a link to this very thread? This seems to be thread 89286.
    Oops, apologies. Now corrected.

    Thank you @Micron.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Hyperlink text is different, url is the same. Keep trying!
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Quote Originally Posted by lalit81 View Post
    Hi There
    This quite doesnt work in my case i checked tried and tested .I am not able to get desired output
    Why doesn't it work? What happens? Show your attempted SQL. Works for me.

    TRANSFORM Max(Table1.amnt) AS MaxOfamnt
    SELECT Table1.invoiceno
    FROM Table1
    GROUP BY Table1.invoiceno
    PIVOT "amnt" & DCount("*","Table1","invoiceno=" & [invoiceno] & " AND ID <=" & [ID]);

    invoiceno amnt1 amnt2 amnt3
    123 77 65
    321 34 44 45
    453 89 87


    You could even provide your db for analysis. Follow instructions at bottom of my post.

    Month is a reserved word and really should not use reserved words as names.


    WGM, link still opens this thread. Here is other https://www.access-programmers.co.uk...ntally.330087/
    And now I see requirement is different and you have solution.
    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.

  9. #9
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by Micron View Post
    Hyperlink text is different, url is the same. Keep trying!
    Not sure how that happened?

    Anyway, correct link this time, and I even tested this one.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  10. #10
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by June7 View Post
    Why doesn't it work? What happens? Show your attempted SQL. Works for me.

    TRANSFORM Max(Table1.amnt) AS MaxOfamnt
    SELECT Table1.invoiceno
    FROM Table1
    GROUP BY Table1.invoiceno
    PIVOT "amnt" & DCount("*","Table1","invoiceno=" & [invoiceno] & " AND ID <=" & [ID]);

    invoiceno amnt1 amnt2 amnt3
    123 77 65
    321 34 44 45
    453 89 87


    You could even provide your db for analysis. Follow instructions at bottom of my post.

    Month is a reserved word and really should not use reserved words as names.


    WGM, link still opens this thread. Here is other https://www.access-programmers.co.uk...ntally.330087/
    Thanks @June7, not sure how you can paste a url but for a different address.?
    This site only allows a url, not any descriptive text, and I would have just copied and pasted anyway?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  11. #11
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Sometimes I forget to copy a url that I've loaded into a tab, and what gets pasted is whatever is on the clipboard. Obvious if not a url but not so obvious if it's the wrong one. Sometimes I open notepad and copy from there, especially if I'm pasting url's that point to each cross post. It's so much easier to put cross posters on IL at AWF.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 1
    Last Post: 05-16-2018, 07:31 PM
  2. Data Entry to Multiple Records
    By Brian_S in forum Access
    Replies: 2
    Last Post: 01-21-2016, 11:53 AM
  3. Replies: 6
    Last Post: 01-20-2016, 05:52 PM
  4. tying data to multiple (or no) records
    By bethtop in forum Forms
    Replies: 2
    Last Post: 11-27-2013, 05:18 PM
  5. Replies: 2
    Last Post: 10-26-2011, 08:56 PM

Tags for this Thread

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