Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Error When Using Left Join on 2 Different Tables

Hi,

 

I'm trying to join 2 tables namely gbkmut (data=Creditor) with GRV_Creditors (data=Creditors) but I'm getting the errors below.

 

Any idea what I'm doing wrong because I had done several Left Joins and all of them worked but this one isn't???

 

Thanks...tksnota...

 

 

 

 

 

 

  • Hi Anonymous ,

    The Error you are showing happens while getting connected to SQL Server. But the Creditor and Creditors column that you are displaying in your sceenshots are from Power BI which may have been replaced after importiing the data.

     

    To have this problem resolved, you should check if this query runs in the SSMS as told by lbendlin . If SSMS cannot be used, try to verify using some other way like some document to know what exactly is the column name in the tables that you are trying to join. If the columns are there, try to see if there are any unwanted spaces before or after the column names in the databases. This also would result in an invalid object.

     

    As the error clearly says, this issue is because of it not able to find the right columns. 

     

    Regards,

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

     

    I trimmed the 2 tables as shown but still have the error

     

     

     

     

     

    • lbendlin's avatar
      lbendlin
      Super User

      This seems to be a SQL specific issue.  Resolve it using SSMS.

  • Anonymous's avatar
    Anonymous
    Not applicable

    I'm aware about SSMS but my company laptop won't allow me to run this program so I'm using the M Code of Power Query

    • lbendlin's avatar
      lbendlin
      Super User

      What about Azure Data Studio?  Not allowed either?

       

      If you don't know the structure of the SQL tables you will need to run some test queries like

       

      SELECT TOP 100 * FROM GRV_CREDITORS

       

      so you can see what the actual column name is.

  • Anonymous's avatar
    Anonymous
    Not applicable

    The error now is invalid syntax but still can't get these 2 tables to be connected

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable
    Hi Anonymous ,

    Thank you for reaching out to the Microsoft Fabric Community Forum regarding the issue you're experiencing.

    Based on the information provided, to use the left outer join between the two tables, ensure that the columns you are joining on in both tables have compatible data types and their names match exactly. It appears that the data types are same, but there is a discrepancy in the column names. Kindly change the column names in both tables and try the join operation again.This might help you to resolve the error.

    If this post helps, please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

  • Hi Anonymous ,

    The Error you are showing happens while getting connected to SQL Server. But the Creditor and Creditors column that you are displaying in your sceenshots are from Power BI which may have been replaced after importiing the data.

     

    To have this problem resolved, you should check if this query runs in the SSMS as told by lbendlin . If SSMS cannot be used, try to verify using some other way like some document to know what exactly is the column name in the tables that you are trying to join. If the columns are there, try to see if there are any unwanted spaces before or after the column names in the databases. This also would result in an invalid object.

     

    As the error clearly says, this issue is because of it not able to find the right columns. 

     

    Regards,