Issue with time showing as fractional seconds.

  • I get the correct information I need it just doesn't seem to want to format it in the

    way I would like. I am having issues where I get the correct time but I would like to display it in a more logial sense instead off fractional seconds. More of a hh:mm:ss . You can see in the elapsed time that it shows the fractional seconds. I would just like Hour , Min , Sec if possible.

    My expression = =Fields!end_date.Value-Fields!start_date.Value

    Below is an example of what currently comes out.

    Any help would be appreciated

    Steve

  • This link might help:

    http://www.mssqltips.com/tip.asp?tip=1145

  • Hey Dan

    I am a little confuesed as to where I would actually put this. The following is my sql statement. In sql it breaks it down into hours , min , sec but when i subtract them it does the fractional seconds..

    SELECT onca_import_history.start_date, onca_import_history.end_date, onca_import_history.process_status, onca_import_history.import_code,

    onca_import_history_error.row_number, onca_import_history_error.error_text, onca_import_history.file_name

    FROM onca_import_history LEFT OUTER JOIN

    onca_import_history_error ON onca_import_history.import_history_id = onca_import_history_error.import_history_id

    WHERE (onca_import_history.start_date >= @startdate) AND (onca_import_history.start_date <= @enddate)

    ORDER BY onca_import_history.start_date

    I would imagine i would use it with one of the following tips.

    TIME FORMATS

    8 or 108 select convert(varchar, getdate(), 8) 00:38:54

    9 or 109 select convert(varchar, getdate(), 9) Dec 30 2006 12:38:54:840AM

    14 or 114 select convert(varchar, getdate(), 14) 00:38:54:840

    Any more help Dan would be much appreciated.

    Steve

  • BUmp.............

    Steve

  • =Format(Fields!elapsedtime.Value, "HH:mm:ss")

    Note - This will only work if the elapsed time never goes above 23:59:59. If it does, there's another way that's a little more complicated.


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

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

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