If the string is SDate Select * from sdutent where left (SDate, 4) & gt; ='2018'If the date format, format take years before first compared with conditions Select * from sdutent where right (convert (varchar (10), SDate), 4) & gt;='2018'
CodePudding user response:
Forget the ms conditions, Select * from sdutent where right (convert (varchar (10), SDate), 4) & gt; And SSex=='2018' 'female'