Jaykzoo
-
10/5/2012 4:19:01 PM
Transformation Script in Repeater
hello,
I have a transformation that has a script to translate a month field into some quarter text. It works correctly on only the first item in my repeater, the rest of the items are not affected. Is there a different way this should be accomplished?
Here's the relevant code: <script runat="server"> string GetQTR(object CodeName) {
if (CodeName != null) { string Code = CodeName.ToString(); switch (Code) { case "1": return "FIRST QUARTER";break; case "2": return "FIRST QUARTER"; break; case "3": return "FIRST QUARTER"; break; case "4": return "SECOND QUARTER"; break; case "5": return "SECOND QUARTER"; break; case "6": return "SECOND QUARTER"; break; case "7": return "THIRD QUARTER"; break; case "8": return "THIRD QUARTER"; break; case "9": return "THIRD QUARTER"; break; case "10": return "FOURTH QUARTER"; break; case "11": return "FOURTH QUARTER"; break; case "12": return "FOURTH QUARTER"; break; } } return (string)CodeName; } </script>
<%# GetQTR(GetDateTime("ReleaseDate", "MM")) %> <%# GetDateTime("ReleaseDate", "yyyy") %>
thanks
|