I am working on a Microsoft SQL Server database and I have the following problem to implement these 2 simple select query.
So I have a table named
where OtherFieldFK like = '70%'
where OtherFieldFK like = '2016%'
the first should be right, as you wrote:
select * from MyTable where OtherFieldFK like = '70%'
for the second should be converted to the date format in the nvarchar (es 121 with this format aaaa-mm-gg hh:mi:ss.mmm(24h)); in this way you can make the comparison with the like:
select * from MyTable where convert(nvarchar,DataInizioGestione,121) like = '2016%'
or you can directly compare the year:
select * from MyTable where year(DataInizioGestione) = 2016