Results 1 to 3 of 3
  1. #1
    rutica is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2009
    Posts
    5

    Look for a value in 3 columns and then create a report

    Hello,

    I am using Access 2010. I have a table with the fields:
    ProjectID
    ProjectName
    AsOfDate
    Prg1
    Prg2
    Prg3
    ProjectID ProjectName AsOfDate Prg1 Prg2 Prg3
    1000 Project1 5/31/2014 FAC BVV-1
    1001 Project2 5/31/2014


    FAC
    1002 Project3 5/31/2014

    MEE
    1003 Project4 5/31/2014
    ABC
    1004 Project5 5/31/2014 ABC

    1005 Project6 5/31/2014


    1006 Project7 5/31/2014

    ABC
    1007 Project8 5/31/2014 FAC BVV-1
    1008 Project9 5/31/2014 BVV-1 MEE ABC

    (I know it's not a good idea to have a wide table, ex: Prg1, Prg2, Prg3, but we get this data from another source, so it comes in this way).

    I'm trying to run a report that shows all the same values from Prg1 plus Prg2 plus Prg3 as the headers. So for example, the report would look like:

    FAC
    Project1
    Project2
    Project8

    BVV-1
    Project1
    Project8
    Project9

    MEE
    Project3
    Project9

    ABC
    Project4
    Project5
    Project7
    Project9

    Thanks!
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,967
    Need to normalize the data for the report output. A UNION query can manipulate the data into normalized structure. Then use that query as report RecordSource. There is no wizard or designer for UNION, must type in SQL view of query builder. Limit of 50 SELECT lines. Forum is not allowing me to type UNION in the query example (weirdness that happens here occasionally). UNION goes where the _____ blanks are.

    SELECT ProjectID, ProjectName, AsOfDate, "P1" As Source, Prg1 As Category FROM tablename
    ______ SELECT ProjectID, ProjectName, AsOfDate, "P2", Prg2 FROM tablename
    ______ SELECT ProjectID, ProjectName, AsOfDate, "P3", Prg3 FROM tablename;
    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
    rutica is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2009
    Posts
    5
    Hi,
    That works great!! Thank you so much. I hadn't considered a Union query. it works perfectly.

    I will mark the thread as solved.

    Thanks again

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

Similar Threads

  1. Replies: 7
    Last Post: 01-16-2014, 09:17 AM
  2. Replies: 5
    Last Post: 10-28-2013, 10:04 PM
  3. How to create plenty of columns in a report
    By petrak in forum Reports
    Replies: 1
    Last Post: 09-23-2011, 01:16 AM
  4. help with columns in report
    By bjsbrown in forum Reports
    Replies: 8
    Last Post: 06-14-2010, 09:17 PM
  5. Replies: 3
    Last Post: 09-19-2008, 02:19 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