Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a criteria to a left outer join

Status
Not open for further replies.

t16turbo

Programmer
Mar 22, 2005
315
GB
I have a query built in the graphical datasource editor.

two of the tables are linked by a LEFT OUTER JOIN

is it possible to then apply a criteria to the RIGHT table, without it then behaving like a normal join?

I tried first of all, specifying that the link is a LEFT outer join.
but because the right table also needs a criteria, as soon as I added it, it kind of ignores the left outer join and is the same as an inner join.

any ideas?

thanks..

 
Not sure exactly what you are doing here but we do a lot of left outer joins and then add criteria like this using ON and the criteria you need from the right table. FX is a table here and OUT is a cursor:

LEFT OUTER JOIN FXRATE FX ON
((FX.AS_OF_DATE = OUT.RPT_DATE AND OUT.RPT_DATE < CURRENT DATE)"
" OR (FX.AS_OF_DATE = OUT.PREV_BUS AND OUT.RPT_DATE >= CURRENT DATE))"
" AND FX.FROM_CCY_CODE = 'USD' "
" AND FX.SOURCE_OF_INFO = '000'"
" AND FX.TO_CCY_CODE = OUT.CURC_CODE"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top