Results 1 to 4 of 4
  1. #1
    rileyma is offline Novice
    Windows 8 Access 2007
    Join Date
    Apr 2014
    Posts
    7

    Reorganizing Table Data

    I'm very new to this forum, so I'm bound to make mistakes. My experience with Access as been selective. Rather than explaining what is needed, I'll provide a current state and the desired state:

    Current State (table)
    Description Line number Line description Dollar
    Line 1 PO 1 1 Body Cost $1.00
    Line 2 PO 1 2 Excise Tax $ .50
    Line 3 PO 1 3 Sales Tax $.25
    Line 4 PO 1 4 Sales Tax $.10



    Desired State (table)

    Description Body Cost Excise Tax Sales Tax 1 sales tax 2
    Line 1 PO 1 $1.00 $.50 $.25 $.10

    Can someone help me to get from the current state to the desired state without creating multiple make table queries?

    Any help would forever make my life easier.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Could try a crosstab query.

    PO number field would be Row Header, concatenate Line Description and Line Number fields as Column Header, Dollar will be the aggregate field.

    If Description includes "Line X" text then this is poor data structure. Line Number is a distinct field and info should not be repeated in Description. Need a field that has only PO number value.
    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
    rileyma is offline Novice
    Windows 8 Access 2007
    Join Date
    Apr 2014
    Posts
    7
    I just wasn't creative enough with the description. I'll give the crosstab.

    Thanks

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    This assumes Line Number for Body Cost is always 1 and Line Number for Excise Tax is always 2 and Line Number for Sales Tax always 3,4.
    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. Replies: 5
    Last Post: 09-06-2013, 11:52 AM
  2. Replies: 13
    Last Post: 10-04-2012, 04:15 PM
  3. Replies: 7
    Last Post: 04-22-2012, 02:28 PM
  4. Replies: 4
    Last Post: 02-27-2012, 10:29 AM
  5. Replies: 4
    Last Post: 01-05-2011, 07:56 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