Changing table data

  • Hi,

    I have a table name 'Time Reported' and the format of the data is :

    1899-12-30 09:12:32.000

    There are 29602 rows of data, this was imported from a old Access database i would like to run a SQL query to remove the 1899-12-30 & the .000 and leave the 09:12:32

    Can anyone assist with a SQL query that will achive this.

    Cheers James

  • DECLARE @TimeReported datetime = '1899-12-30 09:12:32.000';
    DECLARE @NewTime time;
    SET @NewTime = CAST(@TimeReported AS time);
    SELECT @NewTime;

    John

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

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