Select * from #temp
WHERE 1 = 1
AND dbo.brkOwnsTimeshareContract(ISNULL(b.ExternalID2, '0')) = 1;
ALTER FUNCTION [dbo].[brkOwnsTimeshareContract]
(
@OwnerID INT = NULL
)
RETURNS TINYINT
AS
BEGIN
DECLARE @OwnerBucket TINYINT = 0;
IF EXISTS ( SELECT ContractID
FROM dbo.everyware_t_contract c
WHERE c.OwnerID = @OwnerID
AND ( c.ContractStatus = 'Active'
OR CHARINDEX('Phase', c.ContractStatus) > 0
OR CHARINDEX('Pender', c.ContractStatus) > 0
OR CHARINDEX('Suspense', c.ContractStatus) > 0
OR CHARINDEX('Not Back', c.ContractStatus) > 0
OR CHARINDEX('Presale', c.ContractStatus) > 0 )
AND NOT ( CHARINDEX('club', c.ContractType) > 0
OR CHARINDEX('guest', c.ContractType) > 0
OR CHARINDEX('goc co', c.ContractType) > 0
OR CHARINDEX('goc breck', c.ContractType) > 0
OR CHARINDEX('GOC CO $1995', c.ContractType) > 0
OR CHARINDEX('GOC Breck $1295', c.ContractType) > 0
))
AND ISNULL(@OwnerID, 0) > 0
SET @OwnerBucket = 1;
RETURN @OwnerBucket;
END;
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE