Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

UNION Function not working as expected

I have three tables in need to combine into one.  They have the same # of columns, same columns names, data types etc.  When I join table 1 & 2, using UNION, it works with no issues.  When I add table 3, I get the message "Each table argument of 'UNION' must have the same number of columns".   This is confusing as the tables are the same.  Any ideas on what I may be missing and where to look for the problem?

  • Anonymous Hi! it can be a Data Type Mismatch. Check the data types of each column in Table 3 and ensure that they match exactly with those in Table 1 and Table 2.

     

    BBF

  • Hello Anonymous , 

     

    Please check the number of columns and also the data types of each tables this could be the issue that is causing the problem.

     

    If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!

     

    Thank You

    Dharmendar S

    LinkedIN 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Anonymous , hello dharmendars007  and BeaBF, thank you for your prompt reply!

     

    As a supplement, you could also use Append Queries in power query:

    Link: Append queries - Power Query | Microsoft Learn

     

    Best regards,

    Joyce

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • BeaBF's avatar
    BeaBF
    Super User

    Anonymous Hi! it can be a Data Type Mismatch. Check the data types of each column in Table 3 and ensure that they match exactly with those in Table 1 and Table 2.

     

    BBF

  • dharmendars007's avatar
    dharmendars007
    Memorable Member

    Hello Anonymous , 

     

    Please check the number of columns and also the data types of each tables this could be the issue that is causing the problem.

     

    If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!

     

    Thank You

    Dharmendar S

    LinkedIN 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous , hello dharmendars007  and BeaBF, thank you for your prompt reply!

     

    As a supplement, you could also use Append Queries in power query:

    Link: Append queries - Power Query | Microsoft Learn

     

    Best regards,

    Joyce

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.