+ Reply to Thread
Results 1 to 7 of 7

Getting data from two tables into one

  1. #1
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Getting data from two tables into one

    Dear Experts,
    I have two tables in one database both are same the only difference is Table 1 is 2012 data (By Date Jan to Dec) and Table 2 is 2013 Data (By Date from Jan 1 till date).
    Field names & Data types are:
    Field1/Text
    Field2/Number
    Field3/Date
    Field4/Number
    Field5/Text
    Field6/Text
    Field7 to Field 18 Number
    Result I am trying to achieve is Get 2013 Data Between 2 dates(Lets say 01-May to 12-May) and get last years data (Field 7 to 18) next to it. My result should look something like
    Field1/Text of 2013 Table
    Field2/Number of 2013 Table
    Field3/Date of 2013 Table
    Field4/Number of 2013 Table
    Field5/Text of 2013 Table
    Field6/Text of 2013 Table
    Field7 to Field 18 Number of 2013 Table
    &
    Field7 to Field 18 Number of 2012 Table
    Best Regards/VKS
    Last edited by VKS; 05-14-2013 at 01:14 PM.

  2. #2
    Registered User
    Join Date
    05-12-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Getting data from two tables into one

    In 2013 column g try
    =vlookup({field1},sheet11:a1,z999),1,false))

    This will look up column a in a 2012 and display the first column. (Text)
    Then in h
    =vlookup({field1},sheet11:a1,z999),2,false)) number
    Changing 1 2 3 for the column text or number u want to display.

    Field one is the main thing you are looking for, then where you are looking for it, which column you want it to display and wether its an exact match for want your searching for.

    I'm sure you can add a "rows" into this but I'm too drunk to think of it and not that good. The above will work for a novice like me.

    Easiest way is to insert function/vlookup and let excel do the work instead of starting from scratch.

    And I'm assuming your working from 2013 (sheet2) spreadsheet and going backwards.

  3. #3
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Re: Getting data from two tables into one

    Thanks a lot Marshy for your help. Since both the pivot tables are in access i am hoping to learn using access Query.
    Best Regards/VKS

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Getting data from two tables into one

    You will have to join the two tables on a common field (a unique identifier). Which field would that be? It is often referred to as your Primary Key (PK). Until that determination is made, you cannot join the information
    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

  5. #5
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Re: Getting data from two tables into one

    I would want to match date to date as other fields may not be the same. There is no primary key in the tables.
    Thanks/VKS

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Getting data from two tables into one

    How will you do that if one is in year 2012 and the other is 2013? Additionally, is there only one record for each date. If the dates duplicate, you will not get a proper join. I fear that you will have some major issues without a Primary Key to join the tables.

  7. #7
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Re: Getting data from two tables into one

    Thanks a Lot Alan & Marshy, You both have my star for taking the time out and helping me with this issue.
    @ Alan : Initially my idea was to get one more column with just the date number ( 5, 10, 25 etc ) and map number to number since data would be limited to a date/month filter. But, as you said if there are multiple entries (Yes there are aprox 150) then how will that work.
    Thanks once again and marking this as solved as there seems to be no solution with data in its current format.
    Best Regards/VKS

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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