Jump to content
1050356

Passar parametros via query no php para uma consulta Access que pede parametro

Recommended Posts

1050356

Boa tarde,

Eu gostaria de saber se é possivel, e se for como posso faze-lo.

É o seguinte:

Tenho uma consulta gravada no Access 2010, que é a seguinte:

PARAMETERS SomeParam Text ( 255 );

TRANSFORM Count(tempVisitas.IDResp) AS ContarDeIDResp

SELECT [T-RESPONSÁVEL].Responsável

FROM (tempVisitas LEFT JOIN [T-VISITA] ON tempVisitas.IDVisita = [T-VISITA].ID) RIGHT JOIN [T-RESPONSÁVEL] ON tempVisitas.IDResp = [T-RESPONSÁVEL].IDRESP

WHERE (((Format([DataVisita],"yyyy"))=[someParam]))

GROUP BY [T-RESPONSÁVEL].Responsável

ORDER BY Format([DataVisita],"yyyy/mm")

PIVOT Format([DataVisita],"yyyy/mm");

E queria no php lançar uma query que definisse o SomeParam da consulta access, algo do genero:

$sql ="SELECT * FROM [Q-NVisitas/Data_Ano] WHERE Responsável NOT LIKE '%MKT%' AND [someParam] =: ".$ano."";

(...)

Alguem sabe como posso fazer isto?

Obrigado pelo vosso tempo!

Abraço para todos.

1050356

Edited by 1050356

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.