i was trying to search a single term on multiple columns. i got error because one of column was date time. how could i make a generic search with in-line sql. this way i tried.
create table tbl_test1
(id int identity(1,1),
column1 nvarchar(50),
coulmn2 nvarchar(50),
coulmn3 nvarchar(50),
coulmn4 datetime)-- Create a table
insert into tbl_Test1 (column1,coulmn2,coulmn3,coulmn4) values
('Griff','Serjey','Maciej',GETDATE()),
('King','Fisher','Ajay',GETDATE()),
('Paul','Griff','Serjey',GETDATE()),
('King','Fisher','Griff',GETDATE())
select * from tbl_Test1 where 'Griff' IN (column1,coulmn2,coulmn3,coulmn4)
i got this error.
Conversion failed when converting date and/or time from character string.