how to get the response time in days and time

  • I was computing for the response time between two dates including the time rendered.

    I have a table named OSCL and here is the formula of the response time:

    RTime = (u_techInDate + u_techInTime) - (createDate + createTime)

    I have created a view using query analyzer to convert the time into hh:mm format since it is in number format and it has the following attribute mw_techInTime_vw.tit (u_techInTime=tit:string(5) ) also with createtime with mw_ctime_vw.cTime (createTime= cTime:string(5) )

    i wanted to get the result of the response time displaying the number of days + time for example:

    rtime = (04/01/2009 + 12:00pm) - (03/30/2009 + 9:30am)

    = 2 days + 2:30mins

    since this two entity have different attributes one is datetime and the other is string how will i going to combine the two to get the desired output that i wanted.

    please help...

  • It is hard to understand the structure of your tables and views from the description you gave.

    But if I understand the problem correctly I would suggest a slightly different approach.

    I think you should have two datetime (I think smalldatetime will do in your case) fileds in your table.

    One for the start time the other for the end time.

    In order to get your respnse time string you should take the DATEDIFF between the two dates in minutes and pass it into a user defined function (which you have to write) that will format the difference into the string you want.

    The function can be written in T-SQL or if you have .NET experience and hard time formatting the string using T-SQL in C# or VB.NET.

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply