MDX函数妙用-获取当前相关日期

来源:互联网 发布:淘宝买不到115会员 编辑:程序博客网 时间:2024/05/22 15:30

 WITH  MEMBER [Measures].[Full Date] as 'NOW()'
-- The Second Calculated Member is the Day part of the first calculated member.
MEMBER [Measures].[What Day] as 'DAY([Full Date])'
-- The Third Calculated Member is the Month part of the first calculated member.
MEMBER [Measures].[What Month] as 'MONTH([Full Date])'
-- The Fourth Calculated Member is the Year part of the first calculated member.
Member [Measures].[What Year] as 'YEAR([Full Date])'
member [Measures].[What quarter] as 'Datepart(''q'',now())'
SELECT
   {[Full Date],[What Day],[What Month],[What Year],[What quarter]} ON COLUMNS
FROM [adventure works]

原创粉丝点击