Hi friends: here is the solution that is actually working. Of course each of you gave a piece of clue. thanks and I really appreciate your help. regards Mario
DECLARE @DurationAux INT, @DurationStringAux varchar(255) /*here goes the code where @DurationAux takes his numeric value */ SELECT @DurationStringAux= convert(varchar, convert(int,@DurationAux/(60*60))) +':'+convert(varchar,convert(int,@DurationAux/(60))-convert(int,@DurationAux /(60*60))*60) +':'+convert(varchar, @DurationAux-(convert(int,@DurationAux/(60))*60)) ----- Original Message ----- From: "S. Isaac Dealey" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, October 03, 2002 10:45 AM Subject: Re: TSQL > I'm not aware of a simple native way to do this, though you can use dateadd > math... > > select convert(varchar,hour(dateadd(s,#seconds#,#createodbcdate(now())#))) > + ':' + > convert(varchar,minute(dateadd(s,#seconds#,#createodbcdate(now())#))) > + ':' + > convert(varchar,second(dateadd(s,#seconds#,#createodbcdate(now())#))) > > If you're using SQL Server 2000 you could probably create a user defined > function to return a value like this similarly: > > declare @today smalldatetime; > set @today = convert(smalldatetime,convert(int,getdate())); > > then select as above using today and your seconds > > hth > > S. Isaac Dealey > Certified Advanced ColdFusion 5 Developer > > www.turnkey.to > 954-776-0046 > > > Hi folks: > > This question could be innapropiate but this list has always been great . > > Besides I'm a newbie. > > My problem is Transact-SQL related. I want to convert a numeric value (it > > 's > > the amount of seconds a user has spend in one of my sites) to this format > > hh:mm:ss .Is there any function in SQL transact that I could use ??. Any > > piece of advice should be appreciated. > > regards > > Mario > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm

