• Hi

    thanks for the reply. I checkd the link in your signature and, am sorry to say that i dont understand how to do that.

    I am working on an existing SQL database so the 3 tables i am querying are already existing. (see in previously posted attachments).

    if i click on EDIT on the existing table i get:

    USE [SMS_AR_Report]

    GO

    /****** Object: Table [dbo].[HST_Currents] Script Date: 07/30/2013 10:26:47 ******/

    SET ANSI_NULLS OFF

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE TABLE [dbo].[HST_Currents](

    [Timestamp_ID] [bigint] NOT NULL,

    [Device_ID] [int] NOT NULL,

    [Topic_ID] [int] NOT NULL,

    [Sample_Type_ID] [smallint] NOT NULL,

    [Original_Value] [float] NOT NULL

    ) ON [PRIMARY]

    GO

    ALTER TABLE [dbo].[HST_Currents] WITH NOCHECK ADD CONSTRAINT [FK_HST_Currents_Devices] FOREIGN KEY([Device_ID])

    REFERENCES [dbo].[Devices] ([local_Device_ID])

    NOT FOR REPLICATION

    GO

    ALTER TABLE [dbo].[HST_Currents] CHECK CONSTRAINT [FK_HST_Currents_Devices]

    GO

    ALTER TABLE [dbo].[HST_Currents] WITH NOCHECK ADD CONSTRAINT [FK_HST_Currents_Topics] FOREIGN KEY([Topic_ID])

    REFERENCES [dbo].[Topics] ([topic_ID])

    NOT FOR REPLICATION

    GO

    ALTER TABLE [dbo].[HST_Currents] CHECK CONSTRAINT [FK_HST_Currents_Topics]

    All i need help with is How do i modify the followiing query to convert the column "Timestamp_ID" into DATETIME format :

    SELECT Devices.name, Topics.short_name, Topics.name AS PointName, Topics.short_units, Topics.description, HST_Currents.Original_Value,

    HST_Currents.Timestamp_ID

    FROM Devices INNER JOIN

    HST_Currents ON Devices.local_Device_ID = HST_Currents.Device_ID INNER JOIN

    Topics ON HST_Currents.Topic_ID = Topics.topic_ID