Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS SQL Server & have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for

Convert Seconds To Minutes

I need to convert 300.876 to 5:00.876 in classic asp. Can anyone help?

View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Convert Seconds To Hours:minutes:seconds
Hi all.If I've got a query which has a field with seconds in it... how will I usethe Convert function to get my field converted to the format: HH:MM:SS ?The field with the seconds in is called: "Diff"Thanks alotRudi

View Replies !   View Related
Convert Seconds To Hour And Minutes Format
I have a column of data that is the number of seconds.  I need to format this column into the HH:MMS format.  If there are 130 seconds the second column should read 00:02:10.  How can I accomplish this in report builder or is it even possible in Report builder?  I can use the following formula in SQL but is there a way to do it in Report Builder?

CONVERT(varchar(6), talktime / 3600) + ':' + RIGHT('0' + CONVERT(varchar(2),

talktime % 3600 / 60), 2) + ':' + RIGHT('0' + CONVERT(varchar(2), talktime % 60), 2)

View Replies !   View Related
Got Seconds But Need Minutes
I have a result that comes out in number of seconds, but need to see it converted to minutes and hours and seconds. Is there a convert function that would do this?


View Replies !   View Related
Rounding Seconds Up To The Nearest 15 Minutes
I have a field with seconds in it and I need to disply it in hours which I can do by dividing it by 3600, but I am trying to figure out how to round it up to the nearest 15 minutes.  I have tried a couple of things with ROUND and CEILING, but am not getting the right numbers back.  Any help would be greatly appreciated.

View Replies !   View Related
Converting Nvarchar To Minutes:Seconds In MS SQL?
I have a field in nvarchar type. It contains data like 0, :23, 1:57, ... all in minutes and seconds. Now, I need to convert it to MM:SS using query and get the Average of this column. How can I do it? I have tried Avg(Convert(nvarchar(20), [Calling Time], 108)) .. but I got error : The average aggregate operation cannot take a nvarchar data type as an argument.Help!!!! :( 

View Replies !   View Related
Adding Hours, Minutes, Seconds (SQL 2000)
Hi There,

I would like to find the sum of a column with a date format of '01:10:10' which is the hours:minutes:seconds from multiple rows.

For instance, "01:50:10" + "01:20:5" = "3:10:15"

Any ideas?

Using SQL 2000

View Replies !   View Related
Converting Value To Days,hours,minutes & Seconds
Hi Guys,

I have data in minutes which is integer value ex 14454.I wanto convert it to days,hours,minutes & seconds.
Is there any simple way?


View Replies !   View Related
Format Expressions(converting Seconds To Minutes)
can any one tell me how to change  seconds to minutes by using if condition in rss...

for example i have value  of  seconds=50, minutes should come like this 50/60=0.833333.... i got  the answer  ... but the problem  is how to roundoff or truncate the minutes to 0.83 or 0.84 from 0.8333333...

Thanks in anticipation






View Replies !   View Related
TimeAttributeType Error When Add Hours, Minutes And Seconds
In BIDS, I created a time dimension using the wizard. Unfortunately, the template used by the wizard does not contain Hours, Minutes and Seconds; so, I added them using the designer. Now, when I try to build, deploy and process I get the error: Unable to find matching TimeAttributeType. Cannot anyone explain why this is happening and what can be done about? Is there a template available somewhere that does create time dimensions with time and not just dates?

View Replies !   View Related
Getting Date Difference Along With Day,hours,minutes,seconds
Hi All,
         I want to get the date Difference with Day,hours,minutes,seconds of the given 2 dates.(Say the difference of

12/6/2007 7:00:00 AM, 12/8/2007 8:00:00 AM  as 2 days 1:00:00)
 Is there any inbuilt function in SSRS is available to implement this. Or any other way to do this.Please help me with this .Thanks in advance.
With Thanks


View Replies !   View Related
Changing Seconds To Hours And Minutes And Rounding To The Nearest 15 Minute.
I found in another forum that if I take the seconds and divide them by 15 then round up and multiply them by 4 I can get this done, but I can't figure out how to work it into my select statement.  Anyhelp would be greatly appreciated.  dbo.SLPTRANS.TimeSpent is the field I am trying to convert.

SELECT     dbo.SLPTRANS.ClientID, SUM(dbo.SLPTRANS.TransValue) AS Expr1, dbo.SLPTRANS.TimeSpent AS Expr2
                      dbo.INVOICE ON dbo.SLPTRANS.InvoiceID = dbo.INVOICE.RecordID
HAVING      (dbo.SLPTRANS.ClientID = 405)

View Replies !   View Related
How To Convert Seconds To DD:HH:MM:SS
Hello every one I have a column in my table which stores seconds.
I want to convert the value into Days:Hours:Minutes:Secons(DD:HH:MM:SS) format.
Can anybody please tell me how to do that.

The value of seconds wil be large (eg. 16798563,..and so on) SO how to I convert this value to the format I need.

Mohsin Iqbal

View Replies !   View Related
Convert HH:MM:SS Into Seconds

I have an user input variable called @stop_time which takes input in the format of HH:MM:SS.

I need to convert it into seconds only.

declare @start_time datetime
set @start_time ='02:15:00'

How can I do that?

Can anyone help please?

View Replies !   View Related
Convert HH:MM:SS Into Seconds

I have an user input variable called @stop_time which takes input in the format of HH:MM:SS.

I need to convert it into seconds only.

declare @start_time datetime
set @start_time ='02:15:00'

How can I do that?

Can anyone help please?

View Replies !   View Related
Convert HH:MM:SS To Seconds?

How would one convert HH:MM:SS to Seconds?

Thanks in advance!



View Replies !   View Related
Convert Seconds To Hh:mm:ss
How to Convert Seconds (i.e., 114) to hh:mm:ss format,

is there any way.. i've a column (DURATION) which is recorded in Seconds
AND USER wants to see the seconds in hh:mm:ss 00:14:28


View Replies !   View Related
Convert Seconds To Hh:mm:ss
Hi, I have a field with seconds in it, and I need to convert this so that it shows in the format hh:mm:ss. Is there an easy way to do this?

Thanks in advance,


View Replies !   View Related
Convert Seconds To DateTime
I have values in seconds (integers) in a database column and I want to convert those values to datetime. For example: 102 into 1:42(60 seconds = 1 minute + 42 seconds = 1:42), 150 into 2:30, etc.

I've been working for hours today on this, but haven't been able to come up with a solution.

View Replies !   View Related
Convert Minutes To Hours

I want to convert minutes to hours. for example field_minutes=130minutes to 2:10 hours...

select field_minutes from table---> how can I do?


View Replies !   View Related
Convert Number (seconds To Datetime)
I have a field (int) thats a value in seconds.

I need to add it to a datetime value to get a finish time ..

how can i convert it to datetime (baring in mind its seconds)
so far any conversion i do converts it to days...

View Replies !   View Related
Convert Seconds (INT) To Mm:ss In Reporting Services

I have been trying for a while now to convert seconds which are obtainted from the database into the format mm:ss.


Typically in Excel, I convert my time in integer values divided by 86400 (24/60/60) and then format the cell to "mm:ss" and everything is fine.  Now, I am have been trying to reproduce that same logic using Reporting Services (2000) without any success.

I saw on previous post that you can use the format property in RS but if I put in the code "mm:ss" I get the value in text "mm:ss" (i.e.: not the numbers converted). 


Any ideas???




View Replies !   View Related
How Can I Convert Datetime To Number Of Minutes
I have a column in a table that stores the number of hours a task took to do. The column TaskDuration is a datetime datatype. I need to convert the hours to something that can be summed. Does anyone how this can be done? I tried CONVERT(nvarchar(5), tblTasks.TaskDuration, 108) but of course the nvarchar(5) cannot be summed. Maybe there is a way to convert the time portion to minutes and divide it by 60, anyway if someone can offer some help I appreciate it.

View Replies !   View Related
Why Query Takes 0 Seconds And Stored Procedure Takes 16 Seconds Sql Server 2000

I have a Stored Procedure that has a query in it and it take 0 second and then a stored procedure that takes 16 seconds.  From what I can tell they shoul be the same.
It doesn't recompile when i run the stored procedure, I checked that.

View Replies !   View Related
I am really confused and I can’t concentrate. Please help me with this easy question:
I have a field which contains seconds for example 128460 I need to have how much hours is that in my Query.
Please Help me.


View Replies !   View Related
Seconds To HH:MM:SS
I'm using a stored procedure that outputs a field of duration in seconds... I'm limited in that I cannot edit the stored procedure to alter the output but I need to convert this duration to hh:mm:ss. Is there a way to do this using the expression editor in RS 2000?


Many thanks.

View Replies !   View Related
Sleep For N Seconds
HiI am trying to use the WAITFOR function to make each loop in a cursoroccur every 4 seconds until the curdb is emptythe prtocedure is as follows---------------- startcreate procedure q_additionalrabatt@additionalrabatt float,@ordernr intASdeclare @ordradnr intdeclare curdb cursor for select ordernr, ordradnr from orp whereordernr = @ordernrfor read onlyopen curdbfetch curdb into @ordernr, @ordradnrwhile @@fetch_status = 0beginupdateorpsetorp.rabatt1 = (orp.rabatt1 + @additionalrabatt)whereorp.ordernr = @ordernr andorp.ordradnr = @ordradnrfetch curdb into @ordernr, @ordradnrendclose curdbdeallocate curdb------------------- endI need to make sure, that before it fetches the next row it waits 4seconds before executing the next loop.Matt

View Replies !   View Related
Dts Package To Run Every 10 Seconds
Does anyone know if you can shedule a dts package to run every 10 seconds ?
I can see that you can create a job but this only has the option for the earliest run set to 1 minute.

Any advice


View Replies !   View Related
Scheduling Job Every Ten Seconds?
I have a stored procedure that is run from a SQLAgent job every 60 seconds. It works well and reliably. Trouble is I need to schedule the job more often, approximately every 10 seconds. Job/SP checks an input table and processes new arrivals unless automatically turned off while doing heavy db maintenance. The Job Scheduler won't go any faster than 1/minute. Any ideas??

View Replies !   View Related
Adding Seconds

i have a huge table.One of the columns of the table is fTime, which is datetime data type. But there is NO seconds in the fTime column. What i wanna do is to add seconds to this column according to the example below;

2006-07-24 18:10:00----> 2006-07-24 18:10:00
2006-07-24 18:10:00----> 2006-07-24 18:10:59

2006-07-25 10:20:00----> 2006-07-25 10:20:00
2006-07-25 10:20:00----> 2006-07-25 10:20:15
2006-07-25 10:20:00----> 2006-07-25 10:20:30
2006-07-25 10:20:00----> 2006-07-25 10:20:45
2006-07-25 10:20:00----> 2006-07-25 10:20:59

2006-07-25 12:00:00----> 2006-07-25 12:00:00
2006-07-25 12:00:00----> 2006-07-25 12:00:30
2006-07-25 12:00:00----> 2006-07-25 12:00:59

Shortly, as you can understand from above, the first second should be 00, the last second should be 59 and the rest will be calculated by, 60/count of same fTime rows - except the last row. There is one important thing to consider, which is the speed of the statements which include those calculations because of the huge number of rows i my table.


View Replies !   View Related
How To Re-set A Job To Run 10 Minutes Later

I have a job where the first step starts and checks for a condition. If its not true, I want it to reset itself and start again in 10 minutes. I'm using sp_stop_job and sp_update_jobschedule and, initially, it looks like it works. But since it's a Daily job, the 'Next Run Date' increments to the following day. Even though I'm using sp_update_jobschedule to keep the active_start_date as the same day, it still increments. I've tried updating sysjobschedules directly, but get the same results.

Any thoughts much appreciated! Here's my code:
USE msdb

--This is the part that goes in the job step
--and increments the next_run_time if the condition is true.

(Select count('x') from mytable (NoLock)
Where PublicationDate > getdate()) < 1
Declare @ActiveStartDate int
Declare @ActiveStartTime int

Select @ActiveStartDate = active_start_date from msdb.dbo.sysjobschedules (NoLock)
Where schedule_id = 61
Select @ActiveStartTime = active_start_time from msdb.dbo.sysjobschedules (NoLock)
Where schedule_id = 61

EXEC msdb.dbo.sp_stop_job @job_name = 'Owners'
Select @ActiveStartTime = @ActiveStartTime + 1000

EXEC sp_update_jobschedule @job_id = '46C074D4-908D-46AE-8B0C-A23E3AD4A4F6',
@name = 'Daily',
@active_start_date = @ActiveStartDate,
@active_start_time = @ActiveStartTime

View Replies !   View Related
Min/max Of X Minutes
I am trying to develop a sql statement that will create a recordset of the min (or max) values in x minute increments over a period of time.

e.g. over a period of 7 days, I have data that was collected in 1 minute intervals. I need to know the min (or max) value in each 10 minute interval over that same period of time.

Is there an efficient way of doing this?

View Replies !   View Related
Why Does VS Die On Me About Every 30 Minutes?????

I'm using VS 2005 on Vista.  I am developing SSRS reports along with some SSAS and SSIS work.  Every half hour or so the program starts acting strange, windows won't close, the delete key won't work.  When I try to close it I get a window that says a modal box is still open.  I have to open Task Manager and kill it manually.  None of the other developers at my company have this problem but I am the only one doing SSRS work.
If I keep running VS and don't restart it, eventually it will completely freeze.
Is there some problem with VS and SSRS?
I've heard there's a new development tool coming out for SSRS that doesn't use VS.  It can't  come too soon!

View Replies !   View Related
How Can I Use Format As HH:MM:SS From Seconds Within The SQL Query
I have the following SQL query where i want thease to be populate to GridView, but the Duration field is in Second format, I want it would be in HH:MM:SS format.
cmd = "select subscriber_id as Subscriber_no,,amount,duration from MyTable" ;
Please help me how to format this within the Query to display in GridView.

View Replies !   View Related
Help.. Simple Query Took 20+ Seconds
Hi all,

can someone give me some advise on how to troubleshoot this.... thanks.

Here is the situation:

We have a server running nicely for the past 1 years. And just yesterday, things started to acting very slow.
A simple query that will return one row:

"select * from product where itemno = 1234 and visible =1"

will take 20 second sometime 30! The weird thing is.. it only happens intermittently. The table also only contain 4000 rows. so its not even a big table. I am not sure if this is caused by lack of memory or what (256mb ram, p4 1ghz on this server).

The system cpu usage % avg around 3-8%. but when that weird behavior started. All the other queries will wait for it to finished and then burst the cpu usage up to 100%. Afterward, it will level off and then the cycle repeat again.

I'm just hoping if anyone can give me a few pointers as of where to troubleshoot. I've tried rebuild the index on that table but it didn't help. This weird behavior not only happen on this particular table, but also on different db within the same server. (note: they are small dbs only)

p.s. here is the site that is running on this db, you'll see this weird delay after a few click on the pages.

Thanks you for your time,

forgot to mentioned, the sql server is 7.0

View Replies !   View Related
Formatting Seconds In Time

Can you help me with my MDX. I have a datawarehouse which have a table agent_time. Inside it are fields like the agent_id and agent_logintime. The agent_logintime specifies the duration of time in seconds the agent is logged into the system and are in bigInt. Therefore, if the agent is logged in for 3 hrs, the agent_logintime is 10,800. In Analysis Services, how do I do it in MDX if I want to add all the logintime of the agents and display them, instead of in seconds, i want them in time format. Say, 98:45:23 login time (98 hours, 45 minutes and 23 seconds).

I badly need your help!

Thanks a lot.


View Replies !   View Related
GetDate() Won&#39;t Return Seconds
Somehow the Getdate function is not returning me seconds. It's returning it as a smalldatetime. Also when I upsized some tables from Access to SQL 7.0 all my datetime fields came in as smalldatetime instead of datetime.

Has anyone seen this before? Is there some system setting that this is controlled under? How can I get the seconds from the getdate().

Please help, lots of stuff breaking now.

Appreciate it,

View Replies !   View Related
Scheduling Jobs To Run Every X Seconds
I have a requirement from a client for a job to run every 20 seconds. Knowing that the wizards only allow scheduling once a minute I have looked at the sysjobschedules table in msdb and set the freq_subday_type to 2 and freq_subday_interval to 20 for 2 test jobs (both DTS packages).

One of the jobs now schedules every 20 seconds and the other one doesn't.

Please can someone explain how to set-up a DTS package to run at this frequency.

Many thanks


View Replies !   View Related
Grouping A Query In 30 Seconds

How can I make a query and group the registries in a interval of 30

for each line I have a datetime field that have all the day, and I need it to return just like

TIME                                               Contador_type1               Contador_type2       Total

01-01-2006 00:00:30.000                  2                                              5                        7

01-01-2006 00:01:00.000                  3                                               7                        10

 It's just an example...but that's the result that I need and my table is

data_hora -- datetime field

tipo - 1 or 2 -- count

nrtelefone - that's is the number dialed.


View Replies !   View Related
How To Reload Report Every X Seconds?
Is there anyway of including/excluding some javascript to reload the report (with the parameters the user has chosen) on an automatic basis?

View Replies !   View Related
CommandTimeout Shorter Than 30 Seconds?
Today I ran a query from my ASP page that returned with an error message stating my command had timed out. Fine. I searched the forums (thank god for the internet), and added cmd.CommandTimeout = 120. Great! That solved my problem.
My question is that from everything I read, the command timeout is set to 30 seconds by default. Yet my query runs in 5 seconds or so with the property set, but wouldn't run at all without it. Is it possible my command timeout was set somewhere else to less than 30 seconds? It's almost as if the server THOUGHT it would take longer than 30 seconds, and gave up, before actually running the query (which has all needed indexes to make the query fast). I just don't understand why I was getting this error for what turns out to be a 5 second query. When I shorted the query to 4 seconds or so (reducing the date range for the report), it ran fine in 4 seconds without the timeout error. So basically, going to 5 seconds or more caused this error. Where are the other places that the CommandTimeout property might be set? On the SQL Express database itself? I didn't see any ASP.NET config properties addressing it. Is there somewhere else I can look?

View Replies !   View Related
All Records Within X Minutes Of Each Other
Consider a table that holds Internet browsing history for users/machines,date/timed to the minute. The object is to tag all times that are separatedby previous and subsequent times by x number of minutes or less (it couldvary, and wouldn't necessarily be a convenient round number). This willenable reporting "active time" for users (a dubious inference, but hey).There are a lot of derivative ways of seeing this information that might begood to get to. What's the fist and last of these sets of times? Whatpercentage of a given period is spanned by active times, and not? What isthe average duration of such periods? What is the average interval betweenweb hits during such periods? During other times?Blah, blah. The basic problem is my principal problem. I don't have muchexperience with cursors, but from what I understand it would be very goodindeed to spare them, given the number of records I anticipate workingwith.I'd be glad of any pointers.--Scott

View Replies !   View Related
Datetime To Minutes?
hey all, i need to find the ratio of difference in 2 datetime variables and the difference of another 2 datetime vars. I figured the best way to do it is to convert the difference in both numerator and denominator to number of minutes.

can anyone help ??

View Replies !   View Related
:shocked: hi,

I want to use CURRENT_TIMESTAMP - 5 minutes in a select and where clause.

I have tried using

CURRENT_TIMESTAMP - 0.004 AS [Time_-6]

But this is not a round off to a whole minute

Also tried

CURRENT_TIMESTAMP, dateadd(minute, datediff(minute, 0, CURRENT_TIMESTAMP) / 5 * 5, 0)

But this will not do wholes seconds e.g


CURRENT_TIMESTAMP, dateadd(minute, datediff(minute, 0, CURRENT_TIMESTAMP) / 5 * 5, 0) = 10.00.00

Can anyone help??

View Replies !   View Related
Group On Minutes
I need to write a query whioch give me count on
0-15 minutes and then from 0-720 minutes.
I don't know how to group it.
Any help appreciated.

View Replies !   View Related
Date - 15 Minutes
how can i get my date minus 15 minutes in sql?
is there a dateadd function?

View Replies !   View Related
Please Help- How To Add For Evry Row 15 Minutes Wi
please need help
i need to create view_circuit like this
for evry row add 15 minutes with condition by station field

Table before

start time@=14:30

ORDER BY 6,9,15

point_collection employee station seated


start time@=14:30
aaaa 6 station-6

xxxx 9 station-9

nnnnn 9 station-9

cccc 15 station-15

dddd 15 station-15

yyyy 15 station-15



Table After

point_collection employee station seated


14:30 aaaa 6 station-6

14:35 xxxx 9 station-9

14:35 nnnnn 9 station-9

14:40 cccc 15 station-15

14:40 dddd 15 station-15
14:40 yyyy 15 station-15



i must to create different report evry time

with different employee

sometimes i need to change the to evry 10 minutes


sometimes i need to change the to evry 5 minutes ......

i need help how to make it dynamic

and if the station in the next row is the same number than not add +10 OR 5 OR 15 minutes

interval@=5 minutes

interval@=10 minutes

start time@=07:30

sometimes i need to like this

point_collection employee station seated


07:30 aaaa 6 station-6

07:35 xxxx 9 station-11

07:35 nnnnn 4 station-4

07:40 cccc 15 station-15

07:40 dddd 15 station-15

07:40 yyyy 15 station-15




tnx for the help

View Replies !   View Related

Copyright © 2005-08, All rights reserved