Hello,
I created a custom view with this SQL:
SELECT
A.Codice AS "Sede",
COUNT (AP.DataChiamata) AS "Nr Chiamate Effettuate",
COUNT (AP.DataAppuntamento) AS "Appuntamenti",
COUNT (AP.RagioneSociale) AS "Sottoscrizioni",
COUNT (AP.NumeroRichieste) AS "Richieste Sottoscritte",
case when (COUNT(AP.RagioneSociale)>= (COUNT(AP.DataAppuntamento)30/100)) then (COUNT (AP.DataAppuntamento)35) else (COUNT (AP.DataAppuntamento)25) end as "Corrispettivo Appuntamenti",
COUNT (AP.NumeroRichieste)75 AS "Corrispettivo Sottoscrizioni"
FROM Appuntamenti
AP INNER JOIN Ascom A ON A.IDAscom = AP.IDAscom
GROUP BY A.Codice
I should insert a filter for AP.DataAppuntamento, that is:
WHERE AP.DataAppuntamento BETWEEN DataDa AND DataA
How can I make the user choose the DataDa and DataA fields?