AnsweredAssumed Answered

executeSQL statement question

Question asked by padje on Jan 26, 2017
Latest reply on Jan 26, 2017 by padje

Could someone help me with the following SQL statement ?  Thank you so much in advance.

 

This is my statement

 

ExecuteSQL ( "

 

 

SELECT  m.Naam_Full_Materiaalcategorie + ' - ' + s.m_StatusStock

FROM invT03_MAT_Materiaal m

INNER JOIN  invT06_STOCK_Stock s ON s.id_materiaal = m.ID_Materiaal

 

WHERE s.id_transaktie = ?

 

AND

(s.id_StatusStock = 33

OR s.id_StatusStock = 26

OR s.id_StatusStock = 28

OR s.id_StatusStock = 29

OR s.id_StatusStock = 30)

"

 

; "" ; "" ; C_invT01_ANK_START::ID_Aankoop )

 

 

 

 

 

The result is

 

 

Dw - Cymbal boom stand 7700 (hardware drums) - geannuleerd

Dw - Cymbal boom stand 7700 (hardware drums) - geleverd

Dw - Cymbal boom stand 7700 (hardware drums) - geleverd

 

 

 

 

 

I'm looking for this result

 

 

Dw - Cymbal boom stand 7700 (hardware drums) - geannuleerd (1)

Dw - Cymbal boom stand 7700 (hardware drums) - geleverd (2)

 

I only get the question mark when adding GROUP BY and SELECT (COUNT columname), so I must be doing something wrong.

 

Thanks very much for your help.

Outcomes