renti

Distinct + Sum in ExecuteSQL

Discussion created by renti on Dec 3, 2014
Latest reply on Dec 3, 2014 by coherentkris

Hello,

 

I´m trying to calculate the total value of the items in my stock using Execute SQL with the sentence underneath, but filemaker doesnt recognize it.

 

ExecuteSQL

("

SELECT DISTINCT Item_ID , SUM (stock_value)

FROM T03_Warehouse_movements

where Date_field < ?

" ; "" ; "" ; g_date)

 

i only can make it working without the SUM, but then formatting the text is a nightmare.

 

 

thanks,

Outcomes