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.

How to query the data in milliseconds

I have the below query which gets the output in microseconds , is there any way we can get the data in milliseconds please help me to customize\

SELECT [Nodes].Caption , [Nodes].PercentMemoryUsed AS [PercentMemoryUsed_MostRecent] , [Nodes].CPULoad AS [CPULoad_MostRecent] , [Nodes].CPULoadHistory.ObservationTimestamp , [Nodes].CPULoadHistory.AvgLoad , [Nodes].CPULoadHistory.AvgPercentMemoryUsed , [Nodes].Status , [Nodes].LastBoot , [Nodes].DetailsUrl FROM Orion.Nodes AS [Nodes] WHERE ( Caption LIKE '%SULT%' OR Caption LIKE '%WES-MDN-ENT-COR-SW1.ee.mobily.com.sa%' ) -- the Date filter AND [Nodes].CPULoadHistory.ObservationTimestamp >= GETDATE() - 3 ORDER BY [Nodes].Caption , [Nodes].CPULoadHistory.ObservationTimestamp DESC
Output as below :
  • You want to convert ObservationTimestamp from microseconds to milliseconds?  Can I ask why you want the lesser precision?

    If you don't care that it'll be stored as a string, you can just do:

    SubString(ToString([RT].ObservationTimestamp), 1, 23) AS [TimestampToMilliseconds]