Solidworks Electrical Reports - SQL to pull in manufacturer part description (translatable field 0)

Hi,

I'm trying to pull in manufacturer part description (translatable field 0) into a report through the SQL query and am not having much luck. I'm starting with the built-in report "List of Terminations", as it pulls in most of what I want. I'm able to successfully get the manufacturer part main fields using these two lines:

 , tew_buildofmaterial.bom_articlename AS bom_articlename
LEFT JOIN tew_buildofmaterial ON (tew_component.com_id  = bom_objectid)

 

But when I try to add a line like below, it gives an "invalid column name" error:

 , tew_buildofmaterial.bom_tra_0_l1 AS bom_tra_0_l1

 

From what I've seen when asking ChatGPT, translatable fields might be treated differently than the main fields. I'm just having trouble piecing together the details to create a valid SQL query.

 

Any help would be greatly appreciated!

 

Edit, here is the full code. This is the unmodified "List of Terminations" report that comes with Solidworks Electrical. Ultimately, for each termination point, I'd like to grab the associated manufacturer part's article name and description field (which I think is a translatable text field).

SELECT DISTINCT 
  tew_componentparent.com_tagpath AS vcomcom_com_tagpath
 , tew_component.com_tagpath AS com_tagpath
 , tew_component.com_id AS com_id
 , tew_component.com_tagmanual AS com_tagmanual
 , tew_componentelement.cel_group AS cel_group
 , tew_componentelement.cel_orderno AS cel_orderno
 , tew_componentelement.cel_id AS cel_id
 , tew_componentterminal.cte_txt AS cte_txt
 , tew_componentterminal.cte_no AS cte_no
 , vew_wire_ex.cab_id AS cab_id
 , vew_wire_ex.cab_tag AS cab_tag 
 , vew_wire_ex.caw_no AS caw_no
 , vew_wire_ex.caw_section AS caw_section
 , vew_wire_ex.caw_tra_0_l1 AS caw_tra_0_l1
 , vew_wire_ex.wir_tag AS wir_tag
 , vew_wire_ex.wir_id AS wir_id
 , vew_wire_ex.vwircomto_com_id AS vwircomto_com_id
  , vew_wire_ex.wir_type AS wir_type
 , vew_wire_ex.equ_text AS equ_text
 , vew_wire_ex.equ_id AS equ_id
  , vew_wire_ex.equ_columnmark AS equ_columnmark
 , vew_wire_ex.equ_rowmark AS equ_rowmark
 , vew_wire_ex.cab_ductpath AS cab_ductpath
 , vew_wire_ex.vwircomcomfrom_com_tagpath AS vwircomcomfrom_com_tagpath
 , vew_wire_ex.vwircomcomto_com_tagpath AS vwircomcomto_com_tagpath
 , vew_wire_ex.vwircomfrom_com_tagpath AS vwircomfrom_com_tagpath
 , vew_wire_ex.vwircomto_com_tagpath AS vwircomto_com_tagpath
 , vew_wire_ex.vwircomfrom_com_tagmanual AS vwircomfrom_com_tagmanual
 , vew_wire_ex.vwircomto_com_tagmanual AS vwircomto_com_tagmanual
 , vew_wire_ex.vwircelfrom_cel_group AS vwircelfrom_cel_group
 , vew_wire_ex.vwircelto_cel_group AS vwircelto_cel_group
 , vew_wire_ex.vwirctefrom_cte_txt AS vwirctefrom_cte_txt
 , vew_wire_ex.vwircteto_cte_txt AS vwircteto_cte_txt
 , locfrom.loc_tagpath AS locfrom_tagpath
 , locto.loc_tagpath AS locto_tagpath 
 , funfrom.fun_tagpath AS funfrom_tagpath
 , funto.fun_tagpath AS funto_tagpath
 , funfrom.fun_tra_0_l1 AS funfrom_tra_0_l1
 , funto.fun_tra_0_l1 AS funto_tra_0_l1
 , locfrom.loc_tra_0_l1 AS locfrom_tra_0_l1
 , locto.loc_tra_0_l1 AS locto_tra_0_l1
  , locto.loc_id AS loc_to_id
  
 , CASE WHEN  vwircomto_com_id = tew_component.com_id THEN vwircomcomfrom_com_tagpath ELSE vwircomcomto_com_tagpath END AS comdest_comcom_tagpath
 , CASE WHEN  vwircomto_com_id = tew_component.com_id THEN vwircomfrom_com_tagpath ELSE vwircomto_com_tagpath END AS comdest_com_tagpath
 , CASE WHEN  vwircomto_com_id = tew_component.com_id THEN vwircomfrom_com_tagmanual ELSE vwircomto_com_tagmanual END AS comdest_com_tagmanual
 , CASE WHEN  vwircelto_cel_id = cel_id THEN vwircelfrom_cel_group ELSE vwircelto_cel_group END AS comdest_cel_group
 , CASE WHEN  vwircelto_cel_id = cel_id THEN vwirctefrom_cte_txt ELSE vwircteto_cte_txt END AS comdest_cte_txt
 , CASE WHEN  vwircelto_cel_id = cel_id THEN locfrom.loc_tagpath ELSE locto.loc_tagpath END AS comdest_loc_tagpath
 , CASE WHEN  vwircelto_cel_id = cel_id THEN funfrom.fun_tagpath ELSE funto.fun_tagpath END AS comdest_fun_tagpath
 , CASE WHEN  vwircelto_cel_id = cel_id THEN funfrom.fun_tra_0_l1 ELSE funto.fun_tra_0_l1 END AS comdest_fun_tra_0_l1
 , CASE WHEN  vwircelto_cel_id = cel_id THEN locfrom.loc_tra_0_l1 ELSE locto.loc_tra_0_l1 END AS comdest_loc_tra_0_l1

 FROM 
vew_wire_ex
LEFT JOIN tew_componentterminal ON
((vew_wire_ex.wir_cel_idfrom = tew_componentterminal.cte_cel_id) AND (vew_wire_ex.wir_cte_nofrom = tew_componentterminal.cte_no)) 
 OR ((vew_wire_ex.wir_cel_idto = tew_componentterminal.cte_cel_id) AND (vew_wire_ex.wir_cte_noto = tew_componentterminal.cte_no)) 
 LEFT JOIN tew_componentelement ON (tew_componentelement.cel_id = tew_componentterminal.cte_cel_id)
 LEFT JOIN tew_component ON (tew_component.com_id = tew_componentelement.cel_com_id)
 LEFT JOIN tew_component AS tew_componentparent ON (tew_componentparent.com_id = tew_component.com_com_id)
  
LEFT JOIN vew_location AS locfrom ON (vew_wire_ex.vwircomfrom_com_loc_id = locfrom.loc_id) 
LEFT JOIN vew_location AS locto ON (vew_wire_ex.vwircomto_com_loc_id = locto.loc_id) 
LEFT JOIN vew_function AS funfrom ON (vew_wire_ex.vwircomfrom_com_fun_id = funfrom.fun_id) 
LEFT JOIN vew_function AS funto ON (vew_wire_ex.vwircomto_com_fun_id = funto.fun_id) 
     ORDER BY vcomcom_com_tagpath ASC,com_tagpath ASC,com_id ASC,cel_orderno ASC,cte_no ASC