Subject IBOQuery : Filtering problem with left join
Author

Hi,


I have an IBOQuery with an SQL containing a LEFT JOIN


SELECT

  CAST(:USAGER_ AS VARCHAR(10)) AS USAGER, 

  TCSELECT.XS,

  TCCLIENTS.ID_CLIENT,

  TCCLIENTS.CLIENT,

  TCCLIENTS.NOMCLIENT,

  TCCLIENTS.ASSOCIE,

  TCCLIENTS.ENTITE,

  TCCLIENTS.GROUPE,

  TCCLIENTS.GROUPE2,

  TCCLIENTS.RESP,

  TCCLIENTS.REVISEUR,

  TCCLIENTS.FINANNEE

FROM

  TCCLIENTS

  LEFT JOIN TCSELECT ON (TCCLIENTS.CLIENT = TCSELECT.CLIENT AND TCSELECT.USAGER = :USAGER_)


Though, when a filter is applied, like

WHERE ((UPPER( TCCLIENTS.ASSOCIE ) = 'AP'))


All the data from the TCSELECT.XS is lost. When I show the data in a grid, the whole column gets blank. Only a manual RefreshRows will get the data back.


I've tried putting the join conditions in the JoinLinks of the DataSet. This correctly displayed the 'XS' field when a filter was applied, though it corrupted the dataset SQL when further filters were applied (as expected). 


How to automatically get the right 'XS' column value when a filter is applied?

 

Thanks everyone.