Hey Guys! Quick question for anyone willing.
I am trying to make a search widget that will allow a user to input a group name and then it will display the Name of the group along with its availability over the last 30 days.
So far I have this:
SELECT Container.DisplayName, AVG(ContainerStatus.PercentAvailability) AS AVERAGE_Last_30_Days, Primary_ISP, Secondary_ISP
FROM Orion.ContainerStatus
INNER JOIN Orion.Container
ON ContainerStatus.ContainerID = Container.ContainerID
INNER JOIN Orion.GroupCustomProperties
ON ContainerStatus.ContainerID = GroupCustomProperties.ContainerID
WHERE DisplayName LIKE '%${SEARCH_STRING}%' AND DATETIME >=ADDDATE('day',-30, GETDATE())
It works really well, however I am having an issue with formatting. I would like the output of the AVG to round to at least 2 decimal places and right now it is only giving me whole numbers. I essentially want to be able to make the format look like {0:0.00} unit/% that but I am unsure of the syntax or if it is even possible. If anyone has any ideas about this, please let me know!!