Tuesday, February 14, 2012

date/time format with Format_string is not working

with member x as [Date].[Calendar].CurrentMember.Name, format_string = 'mm/yyyy'

select x on 0 ,

[Date].[Calendar].[Date].AllMembers on 1

from [Adventure Works]

When I run this, I get the same value as CurrentMember.name for 'x'. Any ideas?

The .Name is not of type date - instead use .MemberValue:

with member x as [Date].[Calendar].MemberValue, format_string = 'mm/yyyy'

select x on 0 ,

[Date].[Calendar].[Date].Members on 1

from [Adventure Works]

No comments:

Post a Comment