Date ranges

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report that I would like to run with chosen date ranges. Can I
create a parameter for date ranges in a query, so that every time I run the
report, it asks me the date ranges before running it? If so, how?

Thanks!
 
A better way is to place 2 unbound text boxes on a form. From_Date and
To_Date.
reference these text boxes in the query' criteria like this
[Forms]![FormName]![From_Date]
or
between [Forms]![FormName]![From_Date] and [Forms]![FormName]![To_Date]

Place a command button on the form that runs the query
 
How do you create a Between PARAMETER, to pass a range of date to a CrossTab
from a form?

This example doesn’t work:
PARAMETERS Between [Forms]![frmStoreCredits]![txtStartDate] And
[Forms]![frmStoreCredits]![cmdCalDate] DateTime;
--
Thanks, Kevin


Chris Reveille said:
A better way is to place 2 unbound text boxes on a form. From_Date and
To_Date.
reference these text boxes in the query' criteria like this
[Forms]![FormName]![From_Date]
or
between [Forms]![FormName]![From_Date] and [Forms]![FormName]![To_Date]

Place a command button on the form that runs the query
--
Chris


Emmz said:
I have a report that I would like to run with chosen date ranges. Can I
create a parameter for date ranges in a query, so that every time I run the
report, it asks me the date ranges before running it? If so, how?

Thanks!
 
Between is not a parameter. Try this ---
PARAMETERS [Forms]![frmStoreCredits]![txtStartDate] Text 255,
[Forms]![frmStoreCredits]![cmdCalDate] Text 255;

--
KARL DEWEY
Build a little - Test a little


AFSSkier said:
How do you create a Between PARAMETER, to pass a range of date to a CrossTab
from a form?

This example doesn’t work:
PARAMETERS Between [Forms]![frmStoreCredits]![txtStartDate] And
[Forms]![frmStoreCredits]![cmdCalDate] DateTime;
--
Thanks, Kevin


Chris Reveille said:
A better way is to place 2 unbound text boxes on a form. From_Date and
To_Date.
reference these text boxes in the query' criteria like this
[Forms]![FormName]![From_Date]
or
between [Forms]![FormName]![From_Date] and [Forms]![FormName]![To_Date]

Place a command button on the form that runs the query
--
Chris


Emmz said:
I have a report that I would like to run with chosen date ranges. Can I
create a parameter for date ranges in a query, so that every time I run the
report, it asks me the date ranges before running it? If so, how?

Thanks!
 
You actually have to define the parameters

In the grey part of the query grid, right click and select parameters.
on the left side of the dialog box enter your parameters on seperate rows,
and set their data type to Date/Time.

When you view your query in SQL view, you should now have the parameters
declared, and it should look something like:

PARAMETERS [Forms]![frmStoreCredits]![txtStartDate] DateTime,
[Forms]![frmStoreCredits]![cmdCalDate] DateTime;

followed by your SELECT clause.

HTH
Dale


--
Email address is not valid.
Please reply to newsgroup only.


AFSSkier said:
How do you create a Between PARAMETER, to pass a range of date to a CrossTab
from a form?

This example doesn’t work:
PARAMETERS Between [Forms]![frmStoreCredits]![txtStartDate] And
[Forms]![frmStoreCredits]![cmdCalDate] DateTime;
--
Thanks, Kevin


Chris Reveille said:
A better way is to place 2 unbound text boxes on a form. From_Date and
To_Date.
reference these text boxes in the query' criteria like this
[Forms]![FormName]![From_Date]
or
between [Forms]![FormName]![From_Date] and [Forms]![FormName]![To_Date]

Place a command button on the form that runs the query
--
Chris


Emmz said:
I have a report that I would like to run with chosen date ranges. Can I
create a parameter for date ranges in a query, so that every time I run the
report, it asks me the date ranges before running it? If so, how?

Thanks!
 
Didn't work as Text. I changed to DateTime.

PARAMETERS [Forms]![frmStoreCredits]![txtStartDate] DateTime,
[Forms]![frmStoreCredits]![cmdCalDate] DateTime;
--
Thanks, Kevin


KARL DEWEY said:
Between is not a parameter. Try this ---
PARAMETERS [Forms]![frmStoreCredits]![txtStartDate] Text 255,
[Forms]![frmStoreCredits]![cmdCalDate] Text 255;

--
KARL DEWEY
Build a little - Test a little


AFSSkier said:
How do you create a Between PARAMETER, to pass a range of date to a CrossTab
from a form?

This example doesn’t work:
PARAMETERS Between [Forms]![frmStoreCredits]![txtStartDate] And
[Forms]![frmStoreCredits]![cmdCalDate] DateTime;
--
Thanks, Kevin


Chris Reveille said:
A better way is to place 2 unbound text boxes on a form. From_Date and
To_Date.
reference these text boxes in the query' criteria like this
[Forms]![FormName]![From_Date]
or
between [Forms]![FormName]![From_Date] and [Forms]![FormName]![To_Date]

Place a command button on the form that runs the query
--
Chris


:

I have a report that I would like to run with chosen date ranges. Can I
create a parameter for date ranges in a query, so that every time I run the
report, it asks me the date ranges before running it? If so, how?

Thanks!
 
Thanks, Kevin


Dale Fye said:
You actually have to define the parameters

In the grey part of the query grid, right click and select parameters.
on the left side of the dialog box enter your parameters on seperate rows,
and set their data type to Date/Time.

When you view your query in SQL view, you should now have the parameters
declared, and it should look something like:

PARAMETERS [Forms]![frmStoreCredits]![txtStartDate] DateTime,
[Forms]![frmStoreCredits]![cmdCalDate] DateTime;

followed by your SELECT clause.

HTH
Dale


--
Email address is not valid.
Please reply to newsgroup only.


AFSSkier said:
How do you create a Between PARAMETER, to pass a range of date to a CrossTab
from a form?

This example doesn’t work:
PARAMETERS Between [Forms]![frmStoreCredits]![txtStartDate] And
[Forms]![frmStoreCredits]![cmdCalDate] DateTime;
--
Thanks, Kevin


Chris Reveille said:
A better way is to place 2 unbound text boxes on a form. From_Date and
To_Date.
reference these text boxes in the query' criteria like this
[Forms]![FormName]![From_Date]
or
between [Forms]![FormName]![From_Date] and [Forms]![FormName]![To_Date]

Place a command button on the form that runs the query
--
Chris


:

I have a report that I would like to run with chosen date ranges. Can I
create a parameter for date ranges in a query, so that every time I run the
report, it asks me the date ranges before running it? If so, how?

Thanks!
 
Back
Top