I'm trying to display the value of a datetime in a testbox, and I want to vary the format based on a grouping parameter, so I use a binding like this to the format:
=Iif(Parameters.DateGroupFlag.Value = 1, "{0:Y}", Iif(Parameters.DateGroupFlag.Value = 2, "{0:d}", Iif(Parameters.DateGroupFlag.Value = 3, "{0:Y}", Iif(Parameters.DateGroupFlag.Value = 4, "{Y}", Iif(Parameters.DateGroupFlag.Value = 5, "{0:t}", Iif(Parameters.DateGroupFlag.Value = 6, "{0:t}", Iif(Parameters.DateGroupFlag.Value = 7, "{0:Y}", "{0:Y}")))))))
and this basically works, but I don't see how I can handle two special cases.
One is to display the year(eg "2013") only, and the other is to display the day only("Thursday").
Any ideas welcome
=Iif(Parameters.DateGroupFlag.Value = 1, "{0:Y}", Iif(Parameters.DateGroupFlag.Value = 2, "{0:d}", Iif(Parameters.DateGroupFlag.Value = 3, "{0:Y}", Iif(Parameters.DateGroupFlag.Value = 4, "{Y}", Iif(Parameters.DateGroupFlag.Value = 5, "{0:t}", Iif(Parameters.DateGroupFlag.Value = 6, "{0:t}", Iif(Parameters.DateGroupFlag.Value = 7, "{0:Y}", "{0:Y}")))))))
and this basically works, but I don't see how I can handle two special cases.
One is to display the year(eg "2013") only, and the other is to display the day only("Thursday").
Any ideas welcome