sql server - How do I add month number to a hard coded column value in SQL? -


i have hard coded value in sql database , i'd add month number value. here's looks now:

select 'campaign_reviews' [campaign name] 

and value include month number: i.e.

select 'campaign_reviews_month(getdate())' [campaign name] 

is there way accomplish this?

i as:

select 'campaign_reviews_' + right('00' + cast(month(getdate()) varchar(255)), 2) [campaign name] 

this 0 pads number, "01" rather "1". values sort correctly.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -