uwekrueger

Need help with JOIN in sql statement

Discussion created by uwekrueger on Dec 10, 2014
Latest reply on Dec 12, 2014 by uwekrueger

Let ( [

sql="select count (*) from "Injured People" as ip

 

join "Project" AS p on p.kp_ProjectId = e.kf_ProjectId

join "Events" AS e on e.kp_EventNo = ip.kf_EventId

 

where ip."Injury Classification" = ? and ip."Injury Sub Classification" = 'Statistical' and e.Submitted like 'Yes'

 

"

] ;

ExecuteSQL ( sql ; "" ; "" ;"FAI" ) & "¶" &

ExecuteSQL ( sql ; "" ; "" ;"MTI") & "¶" &

ExecuteSQL ( sql ; "" ; "" ;"RWI" ) & "¶" &

ExecuteSQL ( sql ; "" ; "" ;"LTI" ) & "¶" &

ExecuteSQL ( sql ; "" ; "" ;"Fatality" )

)

The above is part of dsiplaying graphs. It works if I delete the first join but returns nothing otherwise. I tried various permutations, reading up solutions, etc.

 

My aim is to replicated the joins between the 3 tables. Project -> Events -> Injured people. The links are based on primary and foreighn keys.

 

Is there something that I am overlooking?

 

Any help is appreciated.

Outcomes