+ Reply to Thread
Results 1 to 9 of 9

Extrat data in Table A from Table B

  1. #1
    Registered User
    Join Date
    04-01-2015
    Location
    HK
    MS-Off Ver
    2013
    Posts
    27

    Extrat data in Table A from Table B

    Please any expert to help me for the problem of access. It is very importance.

    and Sorry my poor english.

    there are two table, One is history (Table A), One is match (Table B).

    Table A include all data. Table B is a list used to search information.

    Table B, There are

    Company 1 Compnay 2
    1 A E
    2 B C
    3 F A



    -------------------------------
    Hope to search in Table A, possible value, use first to do example

    Company 1 Company 2 Business Project (all data in Table A, not Table B)
    A E 1 0
    E A 0 1
    A E 0 1
    A E 0 1
    total 1 3

    A can be Company 1 and A Can be Company 2, then Count how many Business field , and how many project. Other example:

    B C 1 0
    C B 1 0
    Total 2 0

    and result want to

    Outcome :
    Company 1 Compnay 2 Business Project Business % Project %
    1 A E 1 3 25.00% 75.00%
    2 B C 2 0 100.00 % 0.00%



    Also can set the cut off date, for exmaple Since 2014 to now.


    Thank you very much, and my english is very bad. sorry for that.
    Thank you very much
    Attached Files Attached Files
    Last edited by isaacwel01; 04-02-2015 at 01:50 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,028

    Re: Extrat data in Table A from Table B

    crossposted: http://www.mrexcel.com/forum/microso...e-table-b.html

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,028

    Re: Extrat data in Table A from Table B

    Suggest that if you want someone to view your file, then upload to this site. I looked at trying to upload from your link, but the site wanted to download software to my system. I don't want superfluous software or malware on my computer. Will only look at the file if uploaded to this forum.

  4. #4
    Registered User
    Join Date
    04-01-2015
    Location
    HK
    MS-Off Ver
    2013
    Posts
    27

    Re: Extrat data in Table A from Table B

    Thanks, when i post the thred, i don;t know how to add attachment, now is ok, thanks for your suggestion.

  5. #5
    Registered User
    Join Date
    04-01-2015
    Location
    HK
    MS-Off Ver
    2013
    Posts
    27

    Re: Extrat data in Table A from Table B

    alan, please help to have a look the file.

  6. #6
    Registered User
    Join Date
    04-01-2015
    Location
    HK
    MS-Off Ver
    2013
    Posts
    27

    Re: Extrat data in Table A from Table B

    i want to delete the crossposted, but i forgot the password, please give me some time to delete

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,028

    Re: Extrat data in Table A from Table B

    Outcome :
    Company 1 Compnay 2 Business Project Business % Project %
    1 A E 1 3 25.00% 75.00%
    2 B C 2 0 100.00 % 0.00%
    I don't see how the results you wish correspond to the field names you have in your tables. Please expand on your criteria to achieve the results you want. Please explain in simple language what you are attempting as your example does not represent data in the tables provide.

  8. #8
    Registered User
    Join Date
    04-01-2015
    Location
    HK
    MS-Off Ver
    2013
    Posts
    27

    Re: Extrat data in Table A from Table B

    SELECT match.A, match.B, match.C, chistory.D, chistory.E, chistory.F
    FROM [match] INNER JOIN chistory ON ((match.B = chistory.B) AND (match.A = chistory.A)) OR ((match.B = chistory.A) AND (match.A = chistory.B))
    GROUP BY match.A, match.B, match.C, chistory.D, chistory.E, chistory.F;

    The big problem is when filor company 1 (match.B) and company 2 (match.A) sucuss but company 1 (match.A) and company 2 (match.B) not sucess

    means

    match A ---> chistory
    A B ---> A B ok
    ---> but B A not OK

    hard to explain, hope you can understand.

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,028

    Re: Extrat data in Table A from Table B

    Your SQL statement does not match the field names or table names in your example you supplied. I am not a mind reader. If you expect help from this forum, you do need to make sure that the data you supply matches the expressions, formulas and SQL statements otherwise, we are just spinning our wheels trying to understand what is going on.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Extrat with the same formating
    By edclb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2015, 08:23 AM
  2. Replies: 1
    Last Post: 11-28-2013, 02:10 AM
  3. Replies: 0
    Last Post: 07-02-2013, 11:30 AM
  4. Replies: 0
    Last Post: 12-05-2012, 03:48 PM
  5. Replies: 0
    Last Post: 09-05-2012, 06:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1