• Something like below. I don't have test data, so haven't tested it yet.

    Edit: The WHERE conditions on your original query caused the LEFT JOIN to become a de factor INNER JOIN, which threw off the totals. I did more of a query re-write than that to perhaps improve the query overall.

    SELECT

    B.SYNCHMESSAGE as 'td', '',

    MAX(B.row_count) AS [COUNT],

    A.IMPORTMESSAGE as 'td', '',

    MAX(A.row_count) AS [COUNT]

    FROM (

    SELECT

    , SYNCHMESSAGE, COUNT(*) AS row_count

    FROM DataDEV.dbo.SYNCHTERMS

    WHERE

    DATEADDED >= DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()), 0) AND

    DATEADDED < DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()) + 1, 0)

    GROUP BY

    , SYNCHMESSAGE

    ) AS B

    LEFT OUTER JOIN (

    SELECT

    , IMPORTMESSAGE, COUNT(*) AS row_count

    FROM Data.dbo.Data_Errors

    WHERE

    IMPORTDATE >= DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()), 0) AND

    IMPORTDATE < DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()) + 1, 0)

    GROUP BY

    , IMPORTMESSAGE

    ) AS A ON

    A. = B.

    GROUP BY

    B.SYNCHMESSAGE, A.IMPORTMESSAGE

    ORDER BY

    B.SYNCHMESSAGE DESC

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.