I'm trying to complete a search through fields of different types to see if the search value is found. It can be anything the user wants to enter. The problem is the backslashes I believe, making it not read the query properly. How can I search?
select fields from table where fieldA like '%d/m/yy%'....
I've tried typecasting the fields or the var to varchar and then comparing. But I need to find the date in either a datetime field or a text field. Typecasting the search string as a varchar works if I have "fieldA = cast('datestring' as varchar)" but then I get errors for the non-date string searches.
select fields from table where fieldA like '%d/m/yy%'....
I've tried typecasting the fields or the var to varchar and then comparing. But I need to find the date in either a datetime field or a text field. Typecasting the search string as a varchar works if I have "fieldA = cast('datestring' as varchar)" but then I get errors for the non-date string searches.