Google 网上论坛不再支持新的 Usenet 帖子或订阅项。历史内容仍可供查看。

Re: How to format & display a measure which is in seconds to HH:MM:SS

已查看 78 次
跳至第一个未读帖子

Deepak Puri

未读,
2005年2月5日 21:59:012005/2/5
收件人
This MSDN link discusses FORMAT_STRING options for cube measures:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/olapdma
d/agmdxadvanced_2aur.asp


This earlier post shows how to format hh:mm:ss

http://groups-beta.google.com/group/microsoft.public.sqlserver.olap/msg/
13d3af02580a7257
>>
From: Deepak Puri (d...@progressive.com)
Subject: Time format Measure
This is the only article in this thread
View: Original Format
Newsgroups: microsoft.public.sqlserver.olap
Date: 2004-04-24 21:53:31 PST

Try the following format, if time is < 32K seconds:

With Member [Measures].[FormattedASA] as
'TimeSerial(0,0,[Measures].[AvgSpeedAnswer])',
FORMAT_STRING = 'hh:nn:ss'
>>


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Ohjoo Kwon

未读,
2005年2月6日 11:03:162005/2/6
收件人
Siva,

If you mean "elapsed time in seconds", its format is not so easy and you
have to cosider more things because it does not point just "a point in
time".

If the elaspsed time is less than 24 hours, the next format is sufficinet.

WITH
MEMBER Measures.Elasped AS '<Seconds> * 1/60/60/24', FORMAT_STRING =
'hh:mm:ss'

If the elaspsed time is equal to or more than 24 hours, the elapsed days
must be also considered.

WITH
MEMBER Measures.hhmmss AS '<Seconds> * 1/60/60/24'
MEMBER Measures.days AS 'DateDiff("d", CDate(0),CDate(hhmmss))'
MEMBER Measures.Elapsed AS 'CStr(days) + " Days " + Format(hhmmss,
"hh:mm:ss")'

If your final format is more complicate, you also consider using your own
User Defined Function.

Ohjoo Kwon
www.olapforum.com

"Siva" <Si...@discussions.microsoft.com> wrote in message
news:3C8F43BA-A95B-4D70...@microsoft.com...
> Hi,
> I have a measure in seconds. Can any one tell me the mdx code to format
and
> display the measure which is in seconds to HH:MM:SS. Thanks for your help
> --
> Siva


Siva

未读,
2005年2月7日 18:13:032005/2/7
收件人
Thank you Deepu.

Siva

未读,
2005年2月7日 18:15:042005/2/7
收件人
Thank you Ohjoo
0 个新帖子