How to specify a date range in a cross tab report

G

Guest

Hi, I have a crosstab report (well the report is based on a crosstab) which
lists all employees and the dates they have worked. Each date also includes
there normal hours and overtime, and I use a calculated field to work out
what their rate of pay should be.
Anyway, this all works fine, except for the fact that I keep getting a popup
box asking for StartDate and EndDate. How can I insert these progmatically?
The report is useless unless I can specify a date range, as it calculates
employees salaries. Thanks in advance.
 
A

Allen Browne

You can use the parameters in the crosstab if you declare them.

This example assumes you have a form named Form1, where there are text boxes
named StartDate and EndDate.

1. Open your crosstab query in design view.
2. From the Query menu, choose Parameters.
3. Enter 2 lines into the dialog, like this:
[Forms].[Form1].[StartDate] Date/Time
[Forms].[Form1].[EndDate] Date/Time
4. Save the query. Close.

5. Open the form in design view. If the text boxes are unbound, set the
Format property to Short Date so Access knows how to interpret them, and
invalid dates are not accepted. Save.

6. Open the form. Enter the dates. Try the report.
 
G

Guest

Thanks Allen, works perfectly.

Allen Browne said:
You can use the parameters in the crosstab if you declare them.

This example assumes you have a form named Form1, where there are text boxes
named StartDate and EndDate.

1. Open your crosstab query in design view.
2. From the Query menu, choose Parameters.
3. Enter 2 lines into the dialog, like this:
[Forms].[Form1].[StartDate] Date/Time
[Forms].[Form1].[EndDate] Date/Time
4. Save the query. Close.

5. Open the form in design view. If the text boxes are unbound, set the
Format property to Short Date so Access knows how to interpret them, and
invalid dates are not accepted. Save.

6. Open the form. Enter the dates. Try the report.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Toticow said:
Hi, I have a crosstab report (well the report is based on a crosstab)
which
lists all employees and the dates they have worked. Each date also
includes
there normal hours and overtime, and I use a calculated field to work out
what their rate of pay should be.
Anyway, this all works fine, except for the fact that I keep getting a
popup
box asking for StartDate and EndDate. How can I insert these
progmatically?
The report is useless unless I can specify a date range, as it calculates
employees salaries. Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top