sql - Output year and month with a string -


trying output like:

2016,11

using this:

select convert(varchar(20),year(getdate()) + ',' + month(getdate())) yearmonth 

am missing in convert? because getting error:

conversion failed when converting varchar value ',' data type int.

thanks

try this.

select convert(varchar(20),year(getdate())) + ',' + convert(varchar(20),  month(getdate())) yearmonth 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -