• There was an article in the newsletter about Derived Tables that offers a way to resolve your issue by taking the WHERE clause and creating a Derived Table for the subset of rows that meet the Where clause conditions then doing the JOIN on that subset. In that way you would get OUTER JOIN to return unmatched rows as you eliminated the filtering of the WHERE clause.

    http://www.sqlservercentral.com/articles/DerivedTables/61388/

    I am not totally sure but my understanding of the article would indicate the changed query would be similar to this (you will need to verify but the concept is there).

    SELECT TOP 100 PERCENT dbo.genpremloc.level_2, dbo.genpremloc.level_5, dbo.genpremloc.gen_code, dbo.genpremloc.app_budg,

    dbo.genpremloc.adj_budg, dbo.genpremloc.rev_budg, Derived.vwCrystalEstPremisesReport.LineValue, Derived.vwCrystalEstPremisesReport.OrdDate

    FROM dbo.genpremloc LEFT OUTER JOIN

    /* Derived table that covers the WHERE clause */

    (SELECT dbo.genpremloc.level_5, dbo.vwCrystalEstPremisesReport.OrdDate,

    dbo.vwCrystalEstPremisesReport.OrdDate

    FROM dbo.genpremloc JOIN

    dbo.vwCrystalEstPremisesReport ON dbo.genpremloc.gen_code = dbo.vwCrystalEstPremisesReport.gen_code

    WHERE (dbo.genpremloc.level_5 LIKE '5075%') AND (dbo.vwCrystalEstPremisesReport.OrdDate >= CONVERT(DATETIME, '2006-08-01 00:00:00', 102)) AND

    (dbo.vwCrystalEstPremisesReport.OrdDate <= CONVERT(DATETIME, '2007-07-31 00:00:00', 102))) as Derived

    ON dbo.genpremloc.gen_code = Derived.vwCrystalEstPremisesReport.gen_code

    ORDER BY dbo.genpremloc.level_5, dbo.genpremloc.level_2

    Toni