That column is the tIME STAMP (date and time) that a sample of a reading have been taken. I just genertaed insert statement for the first few rows because that table contains thousand of rows! the values are differents in other rows for the TimeStamp_ID Also as i said, i also found a scalar function part of the database wich is as follow:
/****** Object: UserDefinedFunction [dbo].[udfTicksToDateTime] Script Date: 07/30/2013 11:43:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER FUNCTION [dbo].[udfTicksToDateTime]
(
@Ticks BIGINT
)
RETURNS DATETIME AS
BEGIN
DECLARE @DaysBIGINT
DECLARE @DaysBefore1753BIGINT
DECLARE @TimeTicksBIGINT
DECLARE @SecondsBIGINT
IF @Ticks < CONVERT(BIGINT,624511296000000000)
BEGIN
SET @Ticks = CONVERT(BIGINT,624511296000000000)
END
SET @Days = @Ticks / CONVERT(BIGINT,864000000000)
SET @DaysBefore1753 = CONVERT(BIGINT,639905)
SET @TimeTicks = @Ticks % CONVERT(BIGINT,864000000000)
SET @Seconds = @TimeTicks / CONVERT(BIGINT,10000000)
RETURN DATEADD(s,@Seconds,DATEADD(d,@Days - @DaysBefore1753,CONVERT(DATETIME,'1/1/1753')))
END
i think that is the fucntion used to convert the ticks to datetime. i just dont know how i can use it in my query to convert back to datetime