Skip to Content
0
Apr 14, 2010 at 07:38 PM

Conditionally Linked Tables

22 Views

I have a report where I need to be able to get the values from associated tables only where it is applicable by a field value in the main table. When I link the tables "normally" (with a left outer) and put the condition in the Record Selection, I do not get the appropriate records returned. I can use the SQL Override, but would prefer not to.

This would be the equivalent straight SQL query for what I'm looking for -

select count(distinct inv.instancekey)

from middlewareinventory inv

left outer join detailtable detail

on inv.instancekey = detail.instancekey

where (inv.applicationtypeid = 3 and ((detail.servername <> 'not found' and detail.servername is not null)

or inv.isdmz =1))

or applicationtypeid <>3

group by applicationtypeid

Thanks for any ideas on this!