Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ODBC read failed error

Hi all

Please help me with the following error i am getting ..

I am trying to retrieve the data from MS SQL database.


I am getting the ODBC read failed error. for the following sql query,  which joins the two tables

select BB.ID_CO,COUNT(DISTINCT BB.ID_BAG) as NoOfBags,

  COUNT(DISTINCT BB.ID_BOX) as NoOfBOXES,

  BH.ID_CO

from [BAG_BOX_REPORT] BB

  inner join [BAG_BOX_HISTORY] BH

  on  BB.ID_CO=BB.ID_CO

  WHERE BH.ID_CO='7354741'

  AND BR.ID_CO='7354741'

  GROUP BY BB.ID_CO,BH.ID_CO;

below is the screenshot of the error i encounter

ffp odbc err.PNG

I am not getting any error, if i load the both tables individually without any join i am not getting any errors.

Thanks

Ganesh

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

You have 2 fields with same name ID_PO.

Remove one or rename

View solution in original post

8 Replies
Anonymous
Not applicable
Author

Hi Ganesh,

Try this:

select  BB.ID_CO,

      COUNT(DISTINCT BB.ID_BAG) as NoOfBags,

      COUNT(DISTINCT BB.ID_BOX) as NoOfBOXES,

      BH.ID_CO

from [BAG_BOX_REPORT] BB join [BAG_BOX_HISTORY] BH

  WHERE BH.ID_CO='7354741'

  AND BR.ID_CO = BH.ID_CO

  GROUP BY BB.ID_CO,BH.ID_CO;

Regards!!

Clever_Anjos
Employee
Employee

You have 2 fields with same name ID_PO.

Remove one or rename

Not applicable
Author

Hi Manuel

Thanks for the reply

I a getting the following error at where , with the change you suggested

ffp odbc err2.PNG

Thanks

Ganesh

Anonymous
Not applicable
Author

What error do you have on MS SQL Management Tool?

Not applicable
Author

Thanks Clever

I have removed the duplicate field. I thought, since i have used the alias table name on each column name, they will be treated as different fields

Thanks a lot

Not applicable
Author

Thanks for quick reply and helping me  Manuel

Clever_Anjos
Employee
Employee

Ganesh Vara, alias table name are not loaded into Qlik.

Select

  table.fieldA

becomes fieldA

If you need the table name use this

select

  table.fieldA as [table.fieldA]

Not applicable
Author

Thank you...