Crosstab query: problem with "too complex"

diego.gsantos

Registered User.
Local time
Today, 04:28
Joined
Sep 25, 2013
Messages
14
Hello everyone.

I have this crosstab query, that worked fine until I tried to filter it based in two txt fields (initial date and final date).

It's basicaly a table containing tasks (of a kind) done by some vendors.

I just need to filter these tasks by a date interval chose by the user.

Code:
PARAMETERS [Formulários]![Export]![date1] Text ( 255 ), [Formulários]![Export]![date2] Text ( 255 );
TRANSFORM Sum(Tarefas.Cod_Tipo_tarefa) AS SomaDeCod_Tipo_tarefa
SELECT Corretores.Nome_vend
FROM Tarefa_Tipos INNER JOIN (Corretores INNER JOIN Tarefas ON Corretores.Cod_vend = Tarefas.Cod_vend) ON Tarefa_Tipos.cod_tipo_tarefa = Tarefas.Cod_Tipo_tarefa
WHERE (((Tarefas.Data_tarefa) Between [Formulários]![Export]![date1] And [Formulários]![Export]![date2]))
GROUP BY Corretores.Nome_vend
ORDER BY Corretores.Nome_vend
PIVOT Tarefas.Cod_Tipo_tarefa;

If I for example replace the date1 and date2 parameters by Date() and Date()-365 (just as a test)... it works...
-____-

Looking forward for the solution

Thank you.

Diego-gs
 
I think the problem could be that the parameters are defined as Text, and used as criteria on Datetime fieldtype.
Change the parameters to Datetime.
Code:
PARAMETERS [Formulários]![Export]![date1] DateTime, [Formulários]![Export]![date2] DateTime;
 
I think the problem could be that the parameters are defined as Text, and used as criteria on Datetime fieldtype.
Change the parameters to Datetime.
Code:
PARAMETERS [Formulários]![Export]![date1] DateTime, [Formulários]![Export]![date2] DateTime;


It realy solved the problem :D

thank you so much for your help!
 

Users who are viewing this thread

Back
Top Bottom