This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Timestamp Query required

Hi All.

anyone please guide me which thing i need to change in this query

TimeStamp BETWEEN '2019-08-20 08:00:00'                     AND '2019-08-20 14:00:00'

​to get daily report without changing the dates. like yesterday to yesterday report or from today to today report.

jblankjblankidsysmarttin

  • In Reports or Legacy report writer there's "Last 24 hours/last x days" etc timeframes, those are what you'd set it do

    In SWQL or SQL you'd use something like "DATEADD(days, -1, GETUTCDATE())" for the start and GETUTCDATE for the end

  • i am creating a custom reboot report. and i need timestamp SQL query

    by which i can get only yesterday report. instead from start .

    WOuld you please help me regarding this issue, so that i can Schdule a report with yesterday records .

    I will be very thankfull to you.

  • In custom SQL then, in the format you had above

    TimeStamp BETWEEN DATEADD(day, -1, GETUTCDATE())   AND   GETUTCDATE()

    You may need to edit based on how timezones effect your estate etc

    Those are the verbs you need to use anyway, you can use them in whatever way you need

  • HI Adam,

    Thanks for your help.

    can you please tell me how i can get node reboot count report from node reboot event thourgh SQL Query with time stamp.

    thanks

  • I have tried below query and got the total number of reboots per day. But I want the time stamp of each reboot. can you please help me in getting number of reboots, each reboot with the timestamp.

    SELECT COUNT(Events.EventTime) AS COUNT_of_Event_Time,

    Nodes.Caption AS NodeName

    FROM

    Nodes INNER JOIN (Events INNER JOIN EventTypes Events_EventTypes ON (Events.EventType = Events_EventTypes.EventType)) ON (Nodes.NodeID = Events.NetworkNode)

    WHERE

    ( EventTime BETWEEN DATEADD(hour, -18, GETUTCDATE())   AND   GETUTCDATE() )

    AND

    (

      (Events.EventType = 14)

    )

    GROUP BY Nodes.Caption

    ORDER BY 1 DESC

  • There is an alert "Alert me when a node reboots".  Alerts that are triggered have timestamps.  You might want to consider creating a report (or modifying existing).  There are several canned reports for alerts that could be starting points.

  • i almost got the answer, thanks for giving me the way to resolution. thanks