How can I concatenate year, month and day in order to use it in where clause of query?
I tried to do that but it bring error message, The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. SQL State: 22007
Select *
from table_name
where DocDate >= cast(YEAR({?dateto}) as varchar(4)) + '-02-' + cast(DAY({?dateto}) as varchar(2))
Please anyone can help me