dbTalk Databases Forums  

Integer to string conversion???

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Integer to string conversion??? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
BenBoardwell
 
Posts: n/a

Default Integer to string conversion??? - 10-25-2005 , 09:29 AM






Hello All.

Analysis Services - Cubes.

I have a measures field which is the total number of seconds spent on calls
by our salespeople. I'd dearly like to be able to display this in hh:mm:ss
format. e.g. 3661 seconds = 01:01:01

Not a clue how to do it. I've tried using the Generate - String function,
but to no avail.

Can anybody help?

Many thanks

Ben

Reply With Quote
  #2  
Old   
Chris Webb
 
Posts: n/a

Default RE: Integer to string conversion??? - 10-25-2005 , 10:26 AM






This old posting by Deepak might contain some useful information for you
http://groups.google.co.uk/group/mic...e208f6e387d37c

Chris
--
Blog at:
http://spaces.msn.com/members/cwebbbi/


"BenBoardwell" wrote:

Quote:
Hello All.

Analysis Services - Cubes.

I have a measures field which is the total number of seconds spent on calls
by our salespeople. I'd dearly like to be able to display this in hh:mm:ss
format. e.g. 3661 seconds = 01:01:01

Not a clue how to do it. I've tried using the Generate - String function,
but to no avail.

Can anybody help?

Many thanks

Ben

Reply With Quote
  #3  
Old   
dustbort
 
Posts: n/a

Default Re: Integer to string conversion??? - 10-25-2005 , 10:31 AM



Not sure if this is particular to my setup, but the ol' VB functions like
int() and str() may be available to you even if they are not listed by
Analysis Services. You may also have Excel and VBA functions available as
well. I don't know of a modulus operator, though.

"BenBoardwell" <BenBoardwell (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hello All.

Analysis Services - Cubes.

I have a measures field which is the total number of seconds spent on
calls
by our salespeople. I'd dearly like to be able to display this in hh:mm:ss
format. e.g. 3661 seconds = 01:01:01

Not a clue how to do it. I've tried using the Generate - String function,
but to no avail.

Can anybody help?

Many thanks

Ben



Reply With Quote
  #4  
Old   
BenBoardwell
 
Posts: n/a

Default RE: Integer to string conversion??? - 10-28-2005 , 10:27 AM



Thanks for the help Chris and Dust'. Eventually used a combination if T-SQl
(DateAdd) vb (format) and vba (IIF) to get the job done.

e.g. format(DateAdd("s", IIf([Measures].[Answered]>0, [Measures].[Talk
Time]/[Measures].[Answered], 0)
, "01 jan 1900"),"hh:mm:ss")

Ben

"BenBoardwell" wrote:

Quote:
Hello All.

Analysis Services - Cubes.

I have a measures field which is the total number of seconds spent on calls
by our salespeople. I'd dearly like to be able to display this in hh:mm:ss
format. e.g. 3661 seconds = 01:01:01

Not a clue how to do it. I've tried using the Generate - String function,
but to no avail.

Can anybody help?

Many thanks

Ben

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.