Hi
I'm New usig SQL in FM
I succesfully made a query that retrieve grouped Data from a large database.
for the last 12 months I summarized information of two field.
I used the following SQL calculation
ExecuteSQL(
"SELECT TimePeriod , SUM (Total_Sales) AS totalsales , TimePeriod , SUM (Total_Margin) AS totalmargin
FROM bbdd
WHERE bbdd.id_TimePeriod >= ? AND bbdd.Branch = ?
GROUP by TimePeriod";
""; ¶; report::id_last_12M; report::branch)
the field display the data in this way for every branch
TimePeriod Total_Sales TimePeriod Margin
2013M09