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
Post a Comment