REQ: Need Criteria expression that will ask for "from" and "to" dates and then select records that f

  • Thread starter Thread starter Ralph Malph
  • Start date Start date
R

Ralph Malph

I have a query that that prints a bunch of payment records. I need to
beable to print just the records with in a specific time frame. I can
do it if I hard code the date range into the query, but I want it to
ask me for the start date and end date, so I need a criteria
expression that will ask for "from" and "to" dates and then select
records that fall within that date span for access 2000 please. Thanks
for helping in advance.

Ralph Malph
 
Ralph

In the query criteria type the following exactly:

Between [Start Date] and [End Date]

This will bring up two seperate dialog boxes asking for the start and end
date, if you want to change the wording, use some thing different between the
square brackets.

HTH

Neil

www.nwarwick.co.uk
 
Hi Ralph,

Use a criteria like this in your date field:

Between [Enter Start Date] And [Enter End Date]

One word of caution: If the dates entered in your database contain a time
component, then you may miss a record that occurs on the ending date. The
Date/Time datatype is saved as a number, with the integer portion
representing the time of day. For example, April 16, 2005 at 9:00 PM is
actually saved in the table as 38458.875. If the ending date that you enter
is April 16, 2005, the integer portion will equal zero. Thus the record at
9:00 PM on the same day would be greater in value than the criteria entered.
If you have a time component included, then modify the criteria as follows:
=[Enter Start Date] And <DateAdd("d",1,[Enter End Date])

Rather than use a parameter query, you might want to use a form instead. You
can enter the two dates into textboxes on the form. When you click an OK
button, to run the report, you hide the form. The query's criteria looks to
the open form to pick up the date values. This will also provide an easy way
for you to print the from and to dates on the report, since you can grab them
from the hidden, but still open, form.

If you'd like a working example, send me a private e-mail message. Please do
not post your e-mail address to a reply in any newsgroup (unless you love the
idea of getting spammed to death).

Tom

QWCaos168@XScom cas t . Dnet (<---Remove all capitolized letters and
spaces).

________________________________________

:

I have a query that that prints a bunch of payment records. I need to
beable to print just the records with in a specific time frame. I can
do it if I hard code the date range into the query, but I want it to
ask me for the start date and end date, so I need a criteria
expression that will ask for "from" and "to" dates and then select
records that fall within that date span for access 2000 please. Thanks
for helping in advance.

Ralph Malph
 
Thanks Tom !!!! will contact you via e-mail directly....THANKS again
!!!!


Hi Ralph,

Use a criteria like this in your date field:

Between [Enter Start Date] And [Enter End Date]

One word of caution: If the dates entered in your database contain a time
component, then you may miss a record that occurs on the ending date. The
Date/Time datatype is saved as a number, with the integer portion
representing the time of day. For example, April 16, 2005 at 9:00 PM is
actually saved in the table as 38458.875. If the ending date that you enter
is April 16, 2005, the integer portion will equal zero. Thus the record at
9:00 PM on the same day would be greater in value than the criteria entered.
If you have a time component included, then modify the criteria as follows:
=[Enter Start Date] And <DateAdd("d",1,[Enter End Date])

Rather than use a parameter query, you might want to use a form instead. You
can enter the two dates into textboxes on the form. When you click an OK
button, to run the report, you hide the form. The query's criteria looks to
the open form to pick up the date values. This will also provide an easy way
for you to print the from and to dates on the report, since you can grab them
from the hidden, but still open, form.

If you'd like a working example, send me a private e-mail message. Please do
not post your e-mail address to a reply in any newsgroup (unless you love the
idea of getting spammed to death).

Tom

QWCaos168@XScom cas t . Dnet (<---Remove all capitolized letters and
spaces).

________________________________________

:

I have a query that that prints a bunch of payment records. I need to
beable to print just the records with in a specific time frame. I can
do it if I hard code the date range into the query, but I want it to
ask me for the start date and end date, so I need a criteria
expression that will ask for "from" and "to" dates and then select
records that fall within that date span for access 2000 please. Thanks
for helping in advance.

Ralph Malph
 
I have a query that that prints a bunch of payment records. I need to
beable to print just the records with in a specific time frame. I can
do it if I hard code the date range into the query, but I want it to
ask me for the start date and end date, so I need a criteria
expression that will ask for "from" and "to" dates and then select
records that fall within that date span for access 2000 please. Thanks
for helping in advance.

Ralph Malph

Simply use a criterion of

BETWEEN [Enter start date:] AND [Enter end date:]


John W. Vinson[MVP]
 
Ralph

In the query criteria type the following exactly:

Between [Start Date] and [End Date]

This will bring up two seperate dialog boxes asking for the start and end
date, if you want to change the wording, use some thing different between the
square brackets.

HTH

Neil

www.nwarwick.co.uk

Ralph Malph said:
I have a query that that prints a bunch of payment records. I need to
beable to print just the records with in a specific time frame. I can
do it if I hard code the date range into the query, but I want it to
ask me for the start date and end date, so I need a criteria
expression that will ask for "from" and "to" dates and then select
records that fall within that date span for access 2000 please. Thanks
for helping in advance.

Ralph Malph
 
I have a query that that prints a bunch of payment records. I need to
beable to print just the records with in a specific time frame. I can
do it if I hard code the date range into the query, but I want it to
ask me for the start date and end date, so I need a criteria
expression that will ask for "from" and "to" dates and then select
records that fall within that date span for access 2000 please. Thanks
for helping in advance.

Ralph Malph

Simply use a criterion of

BETWEEN [Enter start date:] AND [Enter end date:]


John W. Vinson[MVP]
 
Tom,

THANK you very much for the sample DBs. I can see a way to do what I
want with these examples.

Thanks again !!!!!!

Ralph Malph
 
You're welcome. Glad I could help.

Tom
_____________________________________

:

Tom,

THANK you very much for the sample DBs. I can see a way to do what I
want with these examples.

Thanks again !!!!!!

Ralph Malph
 

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

Back
Top