Friday, November 5, 2010

MDX:Display seconds in dd:HH:mm:ss format

WITH
MEMBER measures.seconds as 25324

MEMBER Measures.ddhhmmss as
cstr(int(measures.seconds/86400)) + ":" + format(cdate(measures.seconds/86400 - int(measures.seconds/86400)), "HH:mm:ss")

SELECT
ddhhmmss on 0 FROM [Adventure Works]


If the format is made as "dd:HH:mm:ss" then it would display the value as 31:02:28:44 and not 01:02:28:44

d/dd: It is supposed to give the day of the month, therefore it can not work for more than 31 days.
example: member measures.x as cdate(95324/86400), FORMAT_STRING = 'd:HH:mm:ss'

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

LinkWithin

Related Posts with Thumbnails