SQL Server DATEPART for year and month -


i have call in sql server 2012 need have working on server 2005 , 2008.

format(date, 'yyyymm') = 201501 using , need use datepart older versions of sql server cannot see way of doing easily.

any appreciated.

earlier versions of sql server don't have format, you'd need like

year(date) = 2015 , month(date) = 1 

or check 2 conditions


Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -