Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Praz
Starting Member
9 Posts |
Posted - 2012-11-16 : 18:56:30
|
Hi,Can you help me out with the correct expression for concatenating the Month name, year and text value?Right now i am using, = Format(MonthName((Month(Today()))-1) + Year(Today()) + "$")and i want a format "October 2012 Payments". Any help or suggestions are appreciated.Thanks Praz |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-11-16 : 23:14:22
|
=MONTHNAME(MONTH(Dateadd(MONTH,-1,Today()))) + " " + CStr(YEAR(Dateadd(MONTH,-1,Today()))) + " Payments"------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
Praz
Starting Member
9 Posts |
Posted - 2012-11-19 : 12:12:13
|
Hi Visakh,Appreciate your help but its still not working!! :(There is some conversion problem with the Date value.ThanksPraz |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-11-19 : 12:44:51
|
See if this will work for you:=MONTHNAME(MONTH(Dateadd("m",-1,Today()))) + " " + CStr(YEAR(Dateadd("m",-1,Today()))) + " Payments" |
|
|
Praz
Starting Member
9 Posts |
Posted - 2012-11-19 : 17:58:23
|
Hi Sunita,It works!! :)ThanksPraz |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-11-20 : 02:57:50
|
Sorry it was a typo. it should have been=MONTHNAME(MONTH(Dateadd(DateInterval.Month,-1,Today()))) + " " + CStr(YEAR(Dateadd(DateInterval.Month,-1,Today()))) + " Payments"------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|
|
|