Tag Info

New answers tagged

1

Are you just looking for distinct Agents that have at least one null invoice and at least one non-null invoice? SELECT [AC].[Agent] FROM [AgentCommTMP] AS [AC] GROUP BY [AC].[Agent] HAVING Count(CASE WHEN [AC].[InvoiceID] IS NULL THEN 1 ELSE Null END) > 0 AND Count(CASE WHEN [AC].[InvoiceID] IS NULL THEN Null ELSE 1 END) > 0



Top 50 recent answers are included