Criteria in CrosstabQuery

Hello Fellows


My questions is:

Is it possible to do the criteria to this crosstabquery

PARAMETERS [Data de Inicio] DateTime, [Data de Fim] DateTime;
TRANSFORM Max(MRodagem1.ListaDeDecores) AS MaxOfListaDeDecores
SELECT MRodagem1.EQUIPA
FROM MRodagem1
WHERE (((MRodagem1.DATA) Between [Data de Inicio] And [Data de Fim]))
GROUP BY MRodagem1.EQUIPA
ORDER BY MRodagem1.EQUIPA
PIVOT MRodagem1.producao.DATA;

from 2 controls in a form, like a regular similar select query?

Thanks in advanced.

Greetings.
Armando Vilela Baiões Self-taughtAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Armando Vilela Baiões Self-taughtAuthor Commented:
Nevermind that, solutionj was in front of me

PARAMETERS [Forms]![frmFScomposicao]![MRDATA1] DateTime, [Forms]![frmFScomposicao]![MRDATA2] DateTime;
TRANSFORM Max(MRodagem1.ListaDeDecores) AS MaxOfListaDeDecores
SELECT MRodagem1.EQUIPA
FROM MRodagem1
WHERE (((MRodagem1.DATA) Between [Forms]![frmFScomposicao]![MRDATA1] And [Forms]![frmFScomposicao]![MRDATA2]))
GROUP BY MRodagem1.EQUIPA
ORDER BY MRodagem1.EQUIPA
PIVOT MRodagem1.producao.DATA;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rey Obrero (Capricorn1)Commented:
<from 2 controls in a form, like a regular similar select query?>

just use the Name of form and control in the where clause and remove the Parameters

WHERE MRodagem1.DATA Between Forms!NameOfForm.NameofControl1 And Forms!NameOfForm.NameofControl2
Armando Vilela Baiões Self-taughtAuthor Commented:
Sorry Rey, i must be tired.... it was such a simple solution. Anyway its solved, These crosstabqueries are full of tricks!
CEOs need to know what they should worry about

Nearly every week during the past few years has featured a headline about the latest data breach, malware attack, ransomware demand, or unrecoverable corporate data loss. Those stories are frequently followed by news that the CEOs at those companies were forced to resign.

Rey Obrero (Capricorn1)Commented:
oh, didn't see your post. it was not there wile I was typing.
Ryan ChongSoftware Team LeadCommented:
the question should be closed by accepting Asker's comment: ID: 42036771 as the answer since he/she solved it by himself.

unless Rey's comment is useful in finding the solution.
Armando Vilela Baiões Self-taughtAuthor Commented:
Thanks to all!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.