Hi nauna,
Refer below query.
SQL
DECLARE @Key VARCHAR(1000) , @Key2 VARCHAR(1000) , @Key3 VARCHAR(1000)
SET @Key =@trucktype
SET @Key2 =@DriverType
SET @Key3 =@searchdate
SELECT @Key = 'LIKE ''%'+ REPLACE(@Key,',','%'' OR trucktype LIKE ''%')+'%'''
SELECT @Key2 = 'LIKE ''%'+ REPLACE(@Key2,',','%'' OR DriverType LIKE ''%')+'%'''
SELECT @Key3 = 'LIKE ''%'+ REPLACE(@Key3,',','%'' OR searchdate LIKE ''%')+'%'''
EXEC('SELECT LoadId, Origin, Destination, TruckType, FP, Length, Weight, DockHours, offerrate, ReferID, Contact, Comment1, Comment2, Insertdate, username, status, format(pickup,''MM/dd/yyyy'') as avail, format(todate,''MM/dd/yyyy'') as todate, DATEDIFF(mi, InsertDate, GETDATE()) / 60.0 AS agem, drivertype , searchdate
FROM LoadPost
WHERE (trucktype '+ @Key +') AND (drivertype '+ @Key2 +') and (searchdate '+ @Key3 +')
UNION ALL
SELECT LoadId, Origin, Destination, TruckType, FP, Length, Weight, DockHours, offerrate, ReferID, Contact, Comment1, Comment2, Insertdate, username, status, format(pickup,''MM/dd/yyyy'') as avail, format(todate,''MM/dd/yyyy'') as todate, DATEDIFF(mi, InsertDate, GETDATE()) / 60.0 AS agem, drivertype , searchdate
FROM LoadPost
WHERE (trucktype '+ @Key +') AND (drivertype '+ @Key2 +') and (searchdate '+ @Key3 +')
order by pickup ')