Line chart x-axis display cumulative

  • Hi,

    In my line chart , I want to display Rev1,Rev2 in the Y axis and InsertDate in the x-axis. However x-axis should be cumulative and instead of showing till 2015-04-13 11:30:00.000 , I want to display x-axis based on current time.

    For example if the current timestamp is 2015-04-13 05:27:00.000, then chart should display only till 2015-04-13 05:30:00.000

    CREATE TABLE #Cumulative

    (

    InsertDate DATETIME,Rev1 FLOAT,Rev2 FLOAT)

    INSERT INTO #Cumulative (InsertDate,Rev1,Rev2)

    SELECT '2015-04-13 00:00:00.000',0,0 UNION ALL

    SELECT '2015-04-13 00:30:00.000',0,0 UNION ALL

    SELECT '2015-04-13 01:00:00.000',0,0 UNION ALL

    SELECT '2015-04-13 01:30:00.000',50,50 UNION ALL

    SELECT '2015-04-13 02:00:00.000',0,0 UNION ALL

    SELECT '2015-04-13 02:30:00.000',0,0 UNION ALL

    SELECT '2015-04-13 03:00:00.000',0,0 UNION ALL

    SELECT '2015-04-13 03:30:00.000',0,0 UNION ALL

    SELECT '2015-04-13 04:00:00.000',100,0 UNION ALL

    SELECT '2015-04-13 04:30:00.000',0,0 UNION ALL

    SELECT '2015-04-13 05:00:00.000',0,0 UNION ALL

    SELECT '2015-04-13 05:30:00.000',0,0

    -- #cumulative table displays all the way up to 2015-04-13 11:30:00.000

    SELECT * FROM #Cumulative

    DROP TABLE #Cumulative

Viewing 0 posts

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