Results 1 to 4 of 4
  1. #1
    Testas is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Posts
    2

    crosstab queary

    Hello,

    I am new here, so sorry if it is not a new question for you.



    I have two tables. First table is "Employee" with fields: name, surname, department, level A, Level B, Level C, level D. Second table is IT system with fields: system name, level letter.
    For examle in first table is record
    John, Smith, sale_department, A,B,null,D
    second table has records:
    Navision, A,
    sale_program, B
    Report_program, C,
    MS_office, D


    How to create a query which must to show with which programs John Smith can work. For example, if i filter John Smith from all other employees result must be a column:
    Navision,
    Sale_program,
    MS_office

    Thanks for a help

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,930
    looks like your table design is incorrect so difficult to do. Resolve the design and it becomes easy

    your levelA-D fields should be in a separate table

    EmpID...Level
    122...…..A
    122...…..B
    122...…..D
    143...…..A
    143...…..C

    etc

    then you would simply link employee table to this table on EmpID and this table to program table on Level

  3. #3
    Testas is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Posts
    2
    I was thinking about that. But in this case it is very hard manage systems level because it would be a very large (long) table and if you want to "remove" system you must to find a row with employee ID and system name. In my case you just removing a level letter in one row from one column. In ms excel it is possible to "copy and paste " "rotate" data. mIs it possible something like this in ms access? For example to write query from first table which result will be:
    john,
    smith,
    A,
    B,
    null,
    C
    ?

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,930
    be clear, excel is about as far removed from database structures as you can get. Simply, they work in completely different ways. To achieve the equivalent of rotate with your present structure you would need a union query to present the data in a normalised structure then apply a crosstab to it.

    But in this case it is very hard manage systems level because it would be a very large (long) table and if you want to "remove" system you must to find a row with employee ID and system name
    it might be hard in excel, easy in a database

    I'm not interested in trying to make a poor structure work, so regret I will have to retire from this thread

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

Similar Threads

  1. Replies: 4
    Last Post: 08-26-2015, 09:55 PM
  2. Crosstab?
    By justin1681 in forum Access
    Replies: 3
    Last Post: 06-27-2012, 12:41 PM
  3. Crosstab Query
    By BLD21 in forum Queries
    Replies: 2
    Last Post: 09-12-2011, 11:58 AM
  4. Crosstab query
    By Deutz in forum Queries
    Replies: 2
    Last Post: 08-23-2011, 06:43 PM
  5. Crosstab example
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-24-2010, 12:07 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