Aaron Vail · Aug 19, 2021

SQL return Operation counts grouped by date?

I'm wanting to write a query in SQL that will return a row with a count for each day for a given month or year for a specific operation or configname.  The following is a start but I'm not finding what I want in the documentation to parse out the TimeLogged field of the table.  Nay help is appreciated.

SELECT count(TimeLogged), ConfigName
FROM Ens_Util.Log
where TimeLogged like '2021-07%'
and ConfigName = 'operation_Name'
group by TimeLogged

Product version: IRIS 2019.1
0 91
Discussion (2)1
Log in or sign up to continue

it makes sense also to display what you group 

SELECT count(*),substr(TimeLogged,1,7), ConfigName
FROM Ens_Util.Log
where TimeLogged %STARTSWITH '2021-07'
and ConfigName = 'operation_Name'
group by substr(TimeLogged,1,7)

You magnificent person!  That will do very nicely!