AnsweredAssumed Answered

ExecuteSQL ?

Question asked by mikeo'neil on Oct 18, 2017
Latest reply on Oct 19, 2017 by mikeo'neil

Hi Folks,

 

I am trying to learn the ExecuteSQL step and its not going too well. I am trying to use this to SUM and COUNT some number fields in a database rewrite. What I would like to do is to Set a Global Field with a COUNT of values contained in a field. The contents in this number field contains a null, zero, or a 1 for a value. I also have a calculation field that contains either a zero or a 1 that I would like to SUM.

 

Table name: Pt_Follow_Up

 

Field Name: Cardiac_Alert_n

Field Name: CNT_ROSC

 

I have created a script to Set a field with the below ExecuteSQL step but receive a “?”.

 

ExecuteSQL ( "SELECT COUNT PT_Follow_Up::Cardiac_Alert_n"; COUNT(PT_Follow_Up::Cardiac_Alert_n) ; "" ; "" ; "")

 

also tried

 

ExecuteSQL ( "SELECT SUM PT_Follow_Up::CNT_ROSC"; SUM(PT_Follow_Up::CNT_ROSC) ; "" ; "" ; "")

 

What am I missing…?

 

I have looked through some examples but have not found a decent explanation or examples.

 

Thanks,

 

Mike

Outcomes