AnsweredAssumed Answered

How to omit 1 type of data using execute sql

Question asked by xxx202xxx on Feb 8, 2018
Latest reply on Feb 8, 2018 by xxx202xxx

I am trying to figure out how to write an execute sql statement to leave out 1 type of data. The data I am attempting to grab is the top five of one column but one of the top fives = NA.  I would like the top 6 minus the NAs which would essentially be the top five.

 

one

two

three

four

NA

five

six

 

 

Let ( [ m =  Month ( Get ( CurrentDate ) ) - 1  ;

               m = If ( m = 0 ; 12 ; m ) ;

               y = Year ( Get ( CurrentDate ) ) - If ( m = 12 ; 1 )

             ];

ExecuteSQL ("

SELECT COUNT (IncidentSummary_Software), IncidentSummary_Software

FROM Service_Management

WHERE MONTH (Date_Created)=?

GROUP BY  IncidentSummary_Software

ORDER BY 1 DESC

FETCH FIRST 6 ROWS ONLY"

;Char (9) & Char (9)  ; "" ; m ) )

Outcomes