Q:

Using AND and OR for different based parameters

I have the below query.
The issue I have is with the following line of the query:
  AND DateOfBirth BETWEEN ISNULL(@LowerDate,DateOfBirth) AND ISNULL(@UpperDate,DateOfBirth)

This is how the parameters are set as an example:
    --works correctly with an OR for DateOfBirth
    --DECLARE @SearchWords NVARCHAR(MAX) = '1995'
    --DECLARE @LowerDate DATE = '01 Jan 1995'
    --DECLARE @UpperDate DATE = '31 Dec 1995'

This displays the Clients with "1995" in one of the text fields, and all clients born between those dates. 
    --works correctly with an AND for DateOfBirth
    --DECLARE @SearchWords NVARCHAR(MAX) = 'mich'
    --DECLARE @LowerDate DATE = NULL
    --DECLARE @UpperDate DATE = NULL

This displays all Clients who have mich somewhere in one of the text fields. 
The first set of parameters get the correct result by using OR DateOfBirth BETWEEN where the second set of parameters get the correct result by using AND DateOfBIrth BETWEEN
How could the query be changed for it to work for both types of parameters being passed?
    CREATE TABLE #SearchWords
    (
        ID int IDENTITY(1,1),
        Word NVARCHAR(50)
    )

    INSERT INTO #SearchWords
    (
        Word
    )
    SELECT 
        value 
    FROM 
        STRING_SPLIT(@SearchWords, ' ')  
    WHERE 
        TRIM(value) <> ''

SELECT
    ClientID,
    FirstName,
    LastName,
    VerificationCode,
    DateOfBirth
FROM Client c
WHERE EXISTS(
          SELECT *
          FROM #SearchWords s
          WHERE (c.FirstName LIKE CONCAT('%',s.Word,'%'))
             OR (c.LastName LIKE CONCAT('%',s.Word,'%'))
             OR (c.VerificationCode LIKE CONCAT('%',s.Word,'%'))
        )
  AND DateOfBirth BETWEEN ISNULL(@LowerDate,DateOfBirth) AND ISNULL(@UpperDate,DateOfBirth)

  drop table #SearchWords

Sample Data with Fiddle - http://sqlfiddle.com/#!6/68162/15 (Query 3 is broken, shouldn't show Richard 1995 and others that don't meet the criteria) 
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Clients](
    [ClientID] [int] NOT NULL,
    [FIrstName] [nvarchar](50) NOT NULL,
    [LastName] [nvarchar](50) NOT NULL,
    [DateOfBirth] [date] NOT NULL,
    [VerificationCode] [nvarchar](100) NOT NULL
)

GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (206, N'Richard 1995', N'Douglas', CAST(N'1948-01-03' AS Date), N'bee')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (404, N'thank', N'yourselves', CAST(N'1995-12-03' AS Date), N'whattt')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (670, N'Ida 1995', N'Delgado', CAST(N'1995-02-03' AS Date), N'mild')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (1506, N'George', N'Coleman', CAST(N'1995-06-03' AS Date), N'brilliance')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (2384, N'Lewis', N'Rice', CAST(N'1995-04-03' AS Date), N'instrument')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (2600, N'Lisa', N'Stanley', CAST(N'1995-06-03' AS Date), N'rice')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (2974, N'Hammett', N'Hopkins', CAST(N'1995-05-03' AS Date), N'snuggle')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (2984, N'Lionel', N'Knox', CAST(N'1995-05-03' AS Date), N'disappoint')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (3105, N'Ciaran', N'Delgado', CAST(N'1995-11-03' AS Date), N'strip')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (3206, N'Lionel', N'Stanley', CAST(N'1995-02-03' AS Date), N'reflect')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (3317, N'Ethan', N'Rice', CAST(N'1995-06-03' AS Date), N'bay')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (3534, N'Jack', N'Vance', CAST(N'1995-04-03' AS Date), N'security')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (3654, N'Elmo', N'Smith', CAST(N'1995-01-03' AS Date), N'sum')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (3881, N'Michelle', N'Watts', CAST(N'1995-11-03' AS Date), N'night')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (4533, N'Otto', N'Hopkins', CAST(N'1995-06-03' AS Date), N'appeal')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (4929, N'Carlos', N'Harrison', CAST(N'1995-02-03' AS Date), N'gree')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (5052, N'Hiram', N'Nunez', CAST(N'1995-08-03' AS Date), N'rumor')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (5148, N'Stephanie', N'Russell', CAST(N'1995-05-03' AS Date), N'expect')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (5240, N'Kato', N'Gibbs', CAST(N'1995-06-03' AS Date), N'appearance')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (5261, N'Josiah', N'St. Onge', CAST(N'1995-11-03' AS Date), N'motivatio')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (5910, N'Dolan', N'Jensen', CAST(N'1995-09-03' AS Date), N'clash')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (6112, N'Kassie', N'Wolf', CAST(N'1995-06-03' AS Date), N'marriage')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (6487, N'Hiram', N'Gibbs', CAST(N'1995-08-03' AS Date), N'precisio')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (6991, N'Arsenio', N'Merrill', CAST(N'1995-08-03' AS Date), N'perform')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (7136, N'Nancy', N'Warner', CAST(N'1995-11-03' AS Date), N'note')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (7452, N'Gil', N'Summerfield', CAST(N'1995-07-03' AS Date), N'emergency')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (7546, N'Kyle', N'Rice', CAST(N'1995-04-03' AS Date), N'eliminate')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (7926, N'Ida', N'Gibbs', CAST(N'1995-10-03' AS Date), N'unity')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (8358, N'Honorato', N'Russell', CAST(N'1995-02-03' AS Date), N'course')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (8603, N'Jodi', N'Watts', CAST(N'1995-01-03' AS Date), N'bottle')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (9610, N'Todd', N'Rose', CAST(N'1995-03-03' AS Date), N'great')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (9823, N'Bill', N'Clarke', CAST(N'1995-10-03' AS Date), N'standard')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (9973, N'Janet', N'Mccoy', CAST(N'1995-05-03' AS Date), N'leftovers')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (10941, N'Hiram', N'Hopkins', CAST(N'1995-06-04' AS Date), N'visible')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (11010, N'Lionel', N'Rice', CAST(N'1995-07-04' AS Date), N'ghostwriter')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (11602, N'Gennifer', N'Russell', CAST(N'1995-01-04' AS Date), N'vessel')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (11803, N'Otto', N'Mcclain', CAST(N'1995-01-04' AS Date), N'skilled')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (11881, N'Yolanda', N'Summerfield', CAST(N'1995-04-04' AS Date), N'feel')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (12080, N'Sherri', N'Chaney', CAST(N'1995-09-04' AS Date), N'court')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (12378, N'Hiram', N'Chaney', CAST(N'1995-11-04' AS Date), N'routine')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (12828, N'Carlos', N'Rose', CAST(N'1995-03-04' AS Date), N'treasurer')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (13065, N'Lionel', N'Gibbs', CAST(N'1995-02-04' AS Date), N'stride')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (13178, N'Josiah', N'Montgomery', CAST(N'1995-01-04' AS Date), N'reductio')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (13933, N'Hiram', N'Rowland', CAST(N'1995-03-04' AS Date), N'ballot')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (14239, N'Samuel', N'Russell', CAST(N'1995-04-04' AS Date), N'workshop')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (14253, N'Donovan', N'Gibbs', CAST(N'1995-08-04' AS Date), N'economist')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (14309, N'Carlos', N'LaPine', CAST(N'1995-04-04' AS Date), N'virgi')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (14332, N'Ida', N'Vega', CAST(N'1995-03-04' AS Date), N'brother')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (14337, N'Donovan', N'Randolph', CAST(N'1995-12-04' AS Date), N'art')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (14592, N'Josiah', N'Sanchez', CAST(N'1995-05-04' AS Date), N'launch')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (14920, N'Brandon', N'Mercado', CAST(N'1995-10-04' AS Date), N'exploit')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (15081, N'Richard', N'Coffey', CAST(N'1995-06-04' AS Date), N'stereotype')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (15347, N'Jarrod', N'Wolf', CAST(N'1995-10-04' AS Date), N'east')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (15607, N'Robert', N'Jensen', CAST(N'1995-02-04' AS Date), N'thoughtful')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (16662, N'Samuel', N'Vega', CAST(N'1995-06-04' AS Date), N'seize')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (17284, N'Francine', N'Bazinaw', CAST(N'1995-01-04' AS Date), N'native')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (17301, N'Kato', N'Harrison', CAST(N'1995-12-04' AS Date), N'jest')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (17576, N'Troy', N'Mcclain', CAST(N'1995-03-04' AS Date), N'discipline')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (17645, N'Jodi', N'Randolph', CAST(N'1995-10-04' AS Date), N'relaxatio')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (18190, N'Hasad', N'Duncan', CAST(N'1995-03-04' AS Date), N'secretary')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (18362, N'Darren', N'Warner', CAST(N'1995-06-04' AS Date), N'charge')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (18771, N'Lionel', N'Gibbs', CAST(N'1995-10-04' AS Date), N'bank')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (18818, N'Erica', N'Mathis', CAST(N'1995-02-04' AS Date), N'surround')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (18830, N'Carlos', N'Rogers', CAST(N'1995-06-04' AS Date), N'reaso')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (19332, N'Kyle', N'Sanchez', CAST(N'1995-10-04' AS Date), N'flu')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (20053, N'Susie', N'Newton', CAST(N'1995-09-04' AS Date), N'concept')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (20070, N'Jennifer', N'Nielsen', CAST(N'1995-06-04' AS Date), N'flood')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (20841, N'Timothy', N'Mccoy', CAST(N'1995-06-04' AS Date), N'fear')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (21916, N'Troy', N'Chaney', CAST(N'1995-01-04' AS Date), N'rise')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (22548, N'Jodi', N'Chaney', CAST(N'1995-06-04' AS Date), N'provide')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (22717, N'Arsenio', N'Douglas', CAST(N'1995-02-04' AS Date), N'fair')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (23934, N'Carla', N'Warner', CAST(N'1995-03-04' AS Date), N'threat')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (24149, N'Troy', N'Mccoy', CAST(N'1995-12-04' AS Date), N'reserve')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (24698, N'Jennifer', N'Mcclain', CAST(N'1995-06-04' AS Date), N'commo')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (25517, N'Kato', N'Vance', CAST(N'1995-08-04' AS Date), N'build')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (25543, N'Hiram', N'Clarke', CAST(N'1995-04-04' AS Date), N'gaffe')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (25980, N'Lionel', N'Mercado', CAST(N'1995-07-04' AS Date), N'war')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (26289, N'Kyle', N'Anderson', CAST(N'1995-11-04' AS Date), N'revenge')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (26376, N'Samuel', N'Carrillo', CAST(N'1995-10-04' AS Date), N'ignite')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (26471, N'Chad', N'Gates', CAST(N'1995-06-04' AS Date), N'theater')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (26611, N'Erica', N'Smith', CAST(N'1995-10-04' AS Date), N'lounge')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (27612, N'Yolanda', N'Hopkins', CAST(N'1995-02-04' AS Date), N'clothes')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (27648, N'John', N'Duncan', CAST(N'1995-10-04' AS Date), N'vertical')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (27666, N'Mitch', N'LaPine', CAST(N'1995-12-04' AS Date), N'straighte')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (27869, N'Otto', N'Nunez', CAST(N'1995-08-04' AS Date), N'visible')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (28307, N'Richard', N'Wolf', CAST(N'1995-06-04' AS Date), N'gold')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (28366, N'Kassie', N'Gibbs', CAST(N'1995-05-04' AS Date), N'colleague')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (28367, N'Kane', N'Douglas', CAST(N'1995-04-04' AS Date), N'rider')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (28592, N'Aquila', N'Morrison', CAST(N'1995-12-04' AS Date), N'reliable')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (28775, N'Gil', N'Chaney', CAST(N'1995-12-04' AS Date), N'wi')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (28996, N'Hiram', N'Vega', CAST(N'1995-12-04' AS Date), N'help')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (29308, N'Jackie', N'Merrill', CAST(N'1995-05-04' AS Date), N'dedicate')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (29469, N'Troy', N'Pate', CAST(N'1995-12-04' AS Date), N'wide')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (29543, N'Stephanie', N'Rice', CAST(N'1995-08-04' AS Date), N'discipline')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (29735, N'Chancellor', N'Hopkins', CAST(N'1995-09-04' AS Date), N'arena')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (29819, N'Erica', N'Knox', CAST(N'1995-12-04' AS Date), N'bald')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (30624, N'Devin', N'Hughey', CAST(N'1995-06-04' AS Date), N'approval')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (31053, N'Jackie', N'Merrill', CAST(N'1995-06-04' AS Date), N'champio')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (31065, N'Ida', N'Wolf', CAST(N'1995-10-04' AS Date), N'crew')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (31424, N'Yolanda', N'Wright', CAST(N'1995-07-04' AS Date), N'cut')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (31913, N'Stephanie', N'Delgado', CAST(N'1995-09-04' AS Date), N'laundry')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (32492, N'Hope', N'Good', CAST(N'1995-10-04' AS Date), N'tired')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (32791, N'Raja', N'Carrillo', CAST(N'1995-05-04' AS Date), N'husband')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (32944, N'Maggie', N'Vega', CAST(N'1995-10-04' AS Date), N'porter')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (32997, N'Colt', N'Clarke', CAST(N'1995-01-04' AS Date), N'monstrous')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (34388, N'Devin', N'Lundeen', CAST(N'1995-07-04' AS Date), N'appreciate')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (34753, N'Josiah', N'Gunter', CAST(N'1995-11-04' AS Date), N'hostility')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (34835, N'Timothy', N'Chaney', CAST(N'1995-06-04' AS Date), N'proposal')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (34908, N'Erica', N'Dingman', CAST(N'1995-05-04' AS Date), N'terms')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (35075, N'Gil', N'Pate', CAST(N'1995-09-04' AS Date), N'appendix')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (35387, N'Kennedy', N'Smith', CAST(N'1995-06-04' AS Date), N'nightmare')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (302, N'Dolan', N'LaPine', CAST(N'1995-07-03' AS Date), N'ghost')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (672, N'Devin', N'Jensen', CAST(N'1995-09-03' AS Date), N'rock')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (686, N'Ciaran', N'Wright', CAST(N'1995-03-03' AS Date), N'canvas')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (1038, N'Lamar', N'Jensen', CAST(N'1995-05-03' AS Date), N'worth')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (1118, N'Richard', N'Stuart', CAST(N'1995-06-03' AS Date), N'wago')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (2414, N'Victor', N'Vega', CAST(N'1995-02-03' AS Date), N'problem')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (2507, N'John', N'Mcclain', CAST(N'1995-09-03' AS Date), N'greeting')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (2665, N'Barb', N'Sanchez', CAST(N'1995-01-03' AS Date), N'presidential')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (2973, N'Lewis', N'Gibbs', CAST(N'1995-05-03' AS Date), N'weed')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (3155, N'Chancellor', N'Duncan', CAST(N'1995-06-03' AS Date), N'smash')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (3382, N'Colt', N'Duncan', CAST(N'1995-11-03' AS Date), N'thaw')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (3589, N'Donna', N'Newton', CAST(N'1995-03-03' AS Date), N'introductio')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (4369, N'Tonya', N'Douglas', CAST(N'1995-02-03' AS Date), N'timber')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (4548, N'Kane', N'Coleman', CAST(N'1995-06-03' AS Date), N'voucher')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (4740, N'Devin', N'Gates', CAST(N'1995-07-03' AS Date), N'retirement')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (4920, N'Lionel', N'Krause', CAST(N'1995-08-03' AS Date), N'eyebrow')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (5344, N'Lisa', N'Rice', CAST(N'1995-11-03' AS Date), N'source')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (6303, N'Jennifer', N'Mcclain', CAST(N'1995-02-03' AS Date), N'day')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (6763, N'George', N'Dow', CAST(N'1995-10-03' AS Date), N'achieve')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (7169, N'Honorato', N'Morrison', CAST(N'1995-09-03' AS Date), N'extort')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (7199, N'Josiah', N'Vega', CAST(N'1995-03-03' AS Date), N'indicatio')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (7766, N'Quinn', N'Delgado', CAST(N'1995-11-03' AS Date), N'romantic')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (8839, N'Otto', N'Espinoza', CAST(N'1995-01-03' AS Date), N'chair')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (8855, N'Victor', N'Mccoy', CAST(N'1995-08-03' AS Date), N'trustee')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (9152, N'Hiram', N'Hopkins', CAST(N'1995-09-03' AS Date), N'flock')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (9551, N'John', N'Merrill', CAST(N'1995-07-03' AS Date), N'mother')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (9638, N'Nancy', N'Hopkins', CAST(N'1995-07-03' AS Date), N'creatio')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (11165, N'Josiah', N'Rowland', CAST(N'1995-07-04' AS Date), N'exercise')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (11430, N'Todd', N'Mcclain', CAST(N'1995-03-04' AS Date), N'collectio')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (13100, N'Donovan', N'Vance', CAST(N'1995-06-04' AS Date), N'post')
GO
INSERT [dbo].[Clients] ([ClientID], [FIrstName], [LastName], [DateOfBirth], [VerificationCode]) VALUES (13497, N'George', N'Krause', CAST(N'1995-06-04' AS Date), N'captai')

GO

A:

This matches both expected results:
or (
     (@LowerDate IS NOT NULL AND DateOfBirth BETWEEN @LowerDate AND @UpperDate)
    )

Query 1:
    DECLARE @SearchWords NVARCHAR(MAX) = 'li'
    DECLARE @LowerDate DATE = NULL
    DECLARE @UpperDate DATE = NULL

SELECT
    'Suggest1',
    ClientID,
    FirstName,
    LastName,
    VerificationCode,
    DateOfBirth
FROM Clients c
WHERE EXISTS(
          SELECT *
          FROM SearchWordsTwo s
          WHERE (c.FirstName LIKE CONCAT('%',s.Word,'%'))
             OR (c.LastName LIKE CONCAT('%',s.Word,'%'))
             OR (c.VerificationCode LIKE CONCAT('%',s.Word,'%'))
        )
or (
     (@LowerDate IS NOT NULL AND DateOfBirth BETWEEN @LowerDate AND @UpperDate)
    )

Results:
|          | ClientID | FirstName | LastName | VerificationCode | DateOfBirth |
|----------|----------|-----------|----------|------------------|-------------|
| Suggest1 |     1506 |    George |  Coleman |       brilliance |  1995-06-03 |
| Suggest1 |     2600 |      Lisa |  Stanley |             rice |  1995-06-03 |
| Suggest1 |     2984 |    Lionel |     Knox |       disappoint |  1995-05-03 |
| Suggest1 |     3206 |    Lionel |  Stanley |          reflect |  1995-02-03 |

Query 2:
-- -------------------------------------------
     --works correctly with an AND for DateOfBirth
    DECLARE @SearchWords NVARCHAR(MAX) = 'li'
    DECLARE @LowerDate DATE = NULL
    DECLARE @UpperDate DATE = NULL

SELECT
    'Correct1',
    ClientID,
    FirstName,
    LastName,
    VerificationCode,
    DateOfBirth
FROM Clients c
WHERE EXISTS(
          SELECT *
          FROM SearchWordsTwo s
          WHERE (c.FirstName LIKE CONCAT('%',s.Word,'%'))
             OR (c.LastName LIKE CONCAT('%',s.Word,'%'))
             OR (c.VerificationCode LIKE CONCAT('%',s.Word,'%'))
        )
  AND DateOfBirth BETWEEN ISNULL(@LowerDate,DateOfBirth) AND ISNULL(@UpperDate,DateOfBirth)

Results:
|          | ClientID | FirstName | LastName | VerificationCode | DateOfBirth |
|----------|----------|-----------|----------|------------------|-------------|
| Correct1 |     1506 |    George |  Coleman |       brilliance |  1995-06-03 |
| Correct1 |     2600 |      Lisa |  Stanley |             rice |  1995-06-03 |
| Correct1 |     2984 |    Lionel |     Knox |       disappoint |  1995-05-03 |
| Correct1 |     3206 |    Lionel |  Stanley |          reflect |  1995-02-03 |

Query 3:
-- -------------------------------------------

    DECLARE @SearchWords NVARCHAR(MAX) = '1995'
    DECLARE @LowerDate DATE = '01 Jan 1995'
    DECLARE @UpperDate DATE = '31 Dec 1995'

SELECT
    'Suggest2',
    ClientID,
    FirstName,
    LastName,
    VerificationCode,
    DateOfBirth
FROM Clients c
WHERE EXISTS(
          SELECT *
          FROM SearchWords s
          WHERE (c.FirstName LIKE CONCAT('%',s.Word,'%'))
             OR (c.LastName LIKE CONCAT('%',s.Word,'%'))
             OR (c.VerificationCode LIKE CONCAT('%',s.Word,'%'))
        )
or (
     (@LowerDate IS NOT NULL AND DateOfBirth BETWEEN @LowerDate AND @UpperDate)
    )

Results:
|          | ClientID |    FirstName |   LastName | VerificationCode | DateOfBirth |
|----------|----------|--------------|------------|------------------|-------------|
| Suggest2 |      206 | Richard 1995 |    Douglas |              bee |  1948-01-03 |
| Suggest2 |      404 |        thank | yourselves |           whattt |  1995-12-03 |
| Suggest2 |      670 |     Ida 1995 |    Delgado |             mild |  1995-02-03 |
| Suggest2 |     1506 |       George |    Coleman |       brilliance |  1995-06-03 |
| Suggest2 |     2384 |        Lewis |       Rice |       instrument |  1995-04-03 |
| Suggest2 |     2600 |         Lisa |    Stanley |             rice |  1995-06-03 |
| Suggest2 |     2974 |      Hammett |    Hopkins |          snuggle |  1995-05-03 |
| Suggest2 |     2984 |       Lionel |       Knox |       disappoint |  1995-05-03 |
| Suggest2 |     3105 |       Ciaran |    Delgado |            strip |  1995-11-03 |
| Suggest2 |     3206 |       Lionel |    Stanley |          reflect |  1995-02-03 |
| Suggest2 |     3317 |        Ethan |       Rice |              bay |  1995-06-03 |
| Suggest2 |     3534 |         Jack |      Vance |         security |  1995-04-03 |
| Suggest2 |     3654 |         Elmo |      Smith |              sum |  1995-01-03 |
| Suggest2 |     3881 |     Michelle |      Watts |            night |  1995-11-03 |
| Suggest2 |     4533 |         Otto |    Hopkins |           appeal |  1995-06-03 |
| Suggest2 |     4929 |       Carlos |   Harrison |             gree |  1995-02-03 |
| Suggest2 |     5052 |        Hiram |      Nunez |            rumor |  1995-08-03 |
| Suggest2 |     5148 |    Stephanie |    Russell |           expect |  1995-05-03 |
| Suggest2 |     5240 |         Kato |      Gibbs |       appearance |  1995-06-03 |

Query 4:
-- -------------------------------------------

   --works correctly with an OR for DateOfBirth
    DECLARE @SearchWords NVARCHAR(MAX) = '1995'
    DECLARE @LowerDate DATE = '01 Jan 1995'
    DECLARE @UpperDate DATE = '31 Dec 1995'

SELECT
    'Correct2',
    ClientID,
    FirstName,
    LastName,
    VerificationCode,
    DateOfBirth
FROM Clients c
WHERE EXISTS(
          SELECT *
          FROM SearchWords s
          WHERE (c.FirstName LIKE CONCAT('%',s.Word,'%'))
             OR (c.LastName LIKE CONCAT('%',s.Word,'%'))
             OR (c.VerificationCode LIKE CONCAT('%',s.Word,'%'))
        )
  OR DateOfBirth BETWEEN ISNULL(@LowerDate,DateOfBirth) AND ISNULL(@UpperDate,DateOfBirth)

Results:
|          | ClientID |    FirstName |   LastName | VerificationCode | DateOfBirth |
|----------|----------|--------------|------------|------------------|-------------|
| Correct2 |      206 | Richard 1995 |    Douglas |              bee |  1948-01-03 |
| Correct2 |      404 |        thank | yourselves |           whattt |  1995-12-03 |
| Correct2 |      670 |     Ida 1995 |    Delgado |             mild |  1995-02-03 |
| Correct2 |     1506 |       George |    Coleman |       brilliance |  1995-06-03 |
| Correct2 |     2384 |        Lewis |       Rice |       instrument |  1995-04-03 |
| Correct2 |     2600 |         Lisa |    Stanley |             rice |  1995-06-03 |
| Correct2 |     2974 |      Hammett |    Hopkins |          snuggle |  1995-05-03 |
| Correct2 |     2984 |       Lionel |       Knox |       disappoint |  1995-05-03 |
| Correct2 |     3105 |       Ciaran |    Delgado |            strip |  1995-11-03 |
| Correct2 |     3206 |       Lionel |    Stanley |          reflect |  1995-02-03 |
| Correct2 |     3317 |        Ethan |       Rice |              bay |  1995-06-03 |
| Correct2 |     3534 |         Jack |      Vance |         security |  1995-04-03 |
| Correct2 |     3654 |         Elmo |      Smith |              sum |  1995-01-03 |
| Correct2 |     3881 |     Michelle |      Watts |            night |  1995-11-03 |
| Correct2 |     4533 |         Otto |    Hopkins |           appeal |  1995-06-03 |
| Correct2 |     4929 |       Carlos |   Harrison |             gree |  1995-02-03 |
| Correct2 |     5052 |        Hiram |      Nunez |            rumor |  1995-08-03 |
| Correct2 |     5148 |    Stephanie |    Russell |           expect |  1995-05-03 |
| Correct2 |     5240 |         Kato |      Gibbs |       appearance |  1995-06-03 |

