Criteria in CrosstabQuery

Armando Vilela Baiões
Armando Vilela Baiões used Ask the Experts™
on
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.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
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;
Top Expert 2016

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

Author

Commented:
Sorry Rey, i must be tired.... it was such a simple solution. Anyway its solved, These crosstabqueries are full of tricks!
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Top Expert 2016

Commented:
oh, didn't see your post. it was not there wile I was typing.
Ryan ChongSoftware Team Lead

Commented:
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.

Author

Commented:
Thanks to all!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial