SELECT cq.QuoteCreator, case when cq.QuoteCreator in (select UserAccount.FullName from UserAccount where UserAccount.FullName = cq.QuoteCreator) then 'T' else 'F' end as QuoteCreatedByFullUser, cq.QuoteLastModifiedUser FROM CustomerQuote cq INNER JOIN Entity a ON (cq.AgentId=a.PartyId) LEFT OUTER JOIN CustomerAccount c ON (cq.QuoteNumber = c.QuoteNumber) LEFT OUTER JOIN Entity s ON (cq.QuoteOwnerId=s.PartyId) LEFT JOIN Entity sp ON s.[SalespersonId] = sp.[PartyId] WHERE cq.QuoteCreateDate between '10/25/2001' AND '10/25/2017' And (cq.QuoteTypeId = '1' Or cq.QuoteTypeId = '3') AND CASE WHEN cq.QuoteLastModifiedUser IS NOT NULL THEN cq.QuoteLastModifiedUser IN (select UserAccount.FullName from UserAccount where UserAccount.FullName = cq.QuoteLastModifiedUser) END order by cq.QuoteNumber
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.