all groups > sql server reporting services > june 2005 >
You're in the

sql server reporting services

group:

Linking a number with a month name


Linking a number with a month name pmud
6/21/2005 12:30:05 PM
sql server reporting services:
Hi,

I have a table with a field called Period whcih has numbers from 1 - 12. Now
I want to say that if the value of the field is 1 , then the report should
display january, if its 2 , Feburary and so on... Is there a way this can be
done without having to create a table ?
--
RE: Linking a number with a month name Sonali
6/21/2005 12:37:01 PM
You can change your query to add column for month name
Oracle =
Monthname(Extract Month from tempdate)

SQL server=
DayPart("m",tempdate)

hope it helps.

[quoted text, click to view]
RE: Linking a number with a month name Harolds
6/21/2005 4:20:02 PM
Go to the Code tab of the Reports Properties dialog and add the following:

function MonthValue(byval MonthInt as integer) as string
select case MonthInt
case 1
return "Jan"
case 2
return "Feb"
'...
case else
return "Bad Month"
End select
end function

Then in the text box where you want the month to display place this
expression:

=Code.MonthValue( Fields!Period.Value)

You can read more about adding code by searching the help for 'Writing
Custom Code'

[quoted text, click to view]
RE: Linking a number with a month name pmud
7/14/2005 7:08:02 AM
Hi Harolds,

That was very helpful.

Thanks
--
pmud


[quoted text, click to view]
RE: Linking a number with a month name Stephen L
11/9/2005 1:02:09 PM
Thanks Guys, this helped me out as well

[quoted text, click to view]
Re: Linking a number with a month name Chris McGuigan
11/10/2005 3:56:09 AM
There is an easier way in the cell itself. There is a VB.net function
MonthName(), so
=MonthName(Month(Fields!MyDate.Value), True)
will give "Jan", "Feb" etc. Change the True to False and you'll get
full month names. I also think it is language aware, so will return the
month in the language the client system is set to.

--
Regards
Chris


[quoted text, click to view]
AddThis Social Bookmark Button