<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>10 Jul 2017 20:07:00 Z</lastBuildDate><pubDate>7 Jul 2017 12:50:00 Z</pubDate><description>Hello to All&#13;
&#13;
I have a little issue trying to set a parameter in a predefined query.&#13;
&#13;
This is the query content:&#13;
SELECT R.data,G.descrizione AS PuntoGuardia,SUM(R.importo_prestazione) AS tot_impo_prescr, COUNT(*) AS tot_prescr, (SELECT COUNT(*) FROM registro LEFT JOIN prestazioni ON registro.tipo_prestazione = prestazioni.id WHERE registro.tipo_prestazione = 1 AND registro.data = r.data AND R.id_gmt = registro.id_gmt) VISIT_AMB, (SELECT COUNT(*) FROM registro LEFT JOIN prestazioni ON registro.tipo_prestazione = prestazioni.id WHERE registro.tipo_prestazione = 2 AND registro.data = r.data AND R.id_gmt = registro.id_gmt) VISIT_DOC, (SELECT COUNT(*) FROM registro LEFT JOIN prestazioni ON registro.tipo_prestazione = prestazioni.id WHERE registro.tipo_prestazione = 3 AND registro.data = r.data AND R.id_gmt = registro.id_gmt) RIP_PRESCR_FARM, (SELECT COUNT(*) FROM registro LEFT JOIN prestazioni ON registro.tipo_prestazione = prestazioni.id WHERE registro.tipo_prestazione = 4 AND registro.data = r.data AND R.id_gmt = registro.id_gmt) RICH_ACCERT_DIAGN_O_RIC, (SELECT COUNT(*) FROM registro LEFT JOIN prestazioni ON registro.tipo_prestazione = prestazioni.id WHERE registro.tipo_prestazione IN(5,7) AND registro.data = r.data AND R.id_gmt = registro.id_gmt) varie, (SELECT COUNT(*) FROM registro LEFT JOIN prestazioni ON registro.tipo_prestazione = prestazioni.id WHERE registro.tipo_prestazione = 6 AND registro.data = r.data AND R.id_gmt = registro.id_gmt) INR, (SELECT COUNT(*) FROM registro LEFT JOIN prestazioni ON registro.tipo_prestazione = prestazioni.id WHERE registro.tipo_prestazione = 8 AND registro.data = r.data AND R.id_gmt = registro.id_gmt) TERAP_INIETTIVA, (SELECT COUNT(*) FROM registro LEFT JOIN prestazioni ON registro.tipo_prestazione = prestazioni.id WHERE registro.tipo_prestazione = 9 AND registro.data = r.data AND R.id_gmt = registro.id_gmt) MISUR_PRESSIONE_ART, (SELECT COUNT(*) FROM registro LEFT JOIN prestazioni ON registro.tipo_prestazione = prestazioni.id WHERE registro.tipo_prestazione = 10 AND registro.data = r.data AND R.id_gmt = registro.id_gmt) VIS_BREVE, (SELECT COUNT(*) FROM registro LEFT JOIN prestazioni ON registro.tipo_prestazione = prestazioni.id WHERE registro.tipo_prestazione = 11 AND registro.data = r.data AND R.id_gmt = registro.id_gmt) VIS_CONTROLLO, (SELECT COUNT(*) FROM registro LEFT JOIN prestazioni ON registro.tipo_prestazione = prestazioni.id WHERE registro.tipo_prestazione = 12 AND registro.data = r.data AND R.id_gmt = registro.id_gmt) CONS_TELEF FROM registro AS R LEFT JOIN id_user I ON R.id_medico = I.User_ID LEFT JOIN guardie G ON R.id_gmt = G.id LEFT JOIN prestazioni P ON R.tipo_prestazione = P.id WHERE g.distretto={pDistretto} GROUP BY R.data, G.descrizione ORDER BY r.data DESC&#13;
As you can see i have a unique parameter to set (pDistretto).&#13;
Reading this forum and the online help, the reccomandation is to use this approach:&#13;
&#13;
nDistretto is int=COMBO_Distretti - 1 {"QRY_Globale.pDistretto"}=nDistretto bRes=HExecuteQuery(QRY_Globale,hQueryDefault)&#13;
I would know if the code above is correct or i need to modify something, because (in case it's correct) i don't obtain the list of records in the table...&#13;
But if i put the value directly (..WHERE g.distretto=1..) the records found are shown on the table...(?!?!?)&#13;
&#13;
Some suggestion??&#13;
Thanks in advance.&#13;
&#13;
Gianni Spano</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/61601-query-parameters/read.awp</link><title>[WD] Query Parameters</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/61601-query-parameters-61674/read.awp</comments><pubDate>10 Jul 2017 20:07:00 Z</pubDate><description>Hi Gianni,&#13;
&#13;
Why are you using the reserved 'indirection' {} characters when assigning the query param.&#13;
- If the query is name…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/61601-query-parameters-61674/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/61601-query-parameters-61674/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/61601-query-parameters/read.awp">[WD] Query Parameters</source><title>Re: [WD] Query Parameters</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/61601-query-parameters-61655/read.awp</comments><pubDate>10 Jul 2017 19:18:00 Z</pubDate><description>Hello Fabrice&#13;
&#13;
Thank you for your reply.&#13;
&#13;
The query QRY_Globale has been built using the query editor and the parameter (pDi…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/61601-query-parameters-61655/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/61601-query-parameters-61655/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/61601-query-parameters/read.awp">[WD] Query Parameters</source><title>Re: [WD] Query Parameters</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/61601-query-parameters-61604/read.awp</comments><pubDate>7 Jul 2017 16:23:00 Z</pubDate><description>Hi&#13;
&#13;
if you query was defined in the query editor (and that is MUCH simpler), then simply do queryName.ParamName=value&#13;
&#13;
If yo…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/61601-query-parameters-61604/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/61601-query-parameters-61604/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/61601-query-parameters/read.awp">[WD] Query Parameters</source><title>Re: [WD] Query Parameters</title></item></channel></rss>
