1

Select getdate()MDXに相当する言語を特定しようとしています。

実際にデータを照会するのではなく、問題のサーバーで日時を取得したいだけです。これは一種のスモーク テストのためのものなので、私ができる最も簡単なステートメントを理解する必要があります。キューブはすべて異なる構造を持っているため、実際にキューブをクエリしたくありません。サーバーに接続してサーバーレベルの情報を取得するだけです(必ずしもデータではありません)。

ありがとう。

4

1 に答える 1

2

SQL Server 2000 Analysis Services で MDX クエリまたは式を使用して現在の日付を取得する方法を引用します。

答えは次のとおりです。

-- The First Calculated member is the value of NOW()
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])'
SELECT
   {[Full Date],[What Day],[What Month],[What Year]} ON COLUMNS
FROM Sales

結果:

Full  Date   What Day        What Month     What Year
1:16:16 AM   19              9              2001

記事は SASS 2000 用ですが、2008 R2 で実行する必要があります。

于 2012-02-06T20:43:43.577 に答える