Specific Date Criteria

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

Guest

Hi Access Users. I've reviewed many of the questions previously answered
here but cannot find a simple answer - some of the questions require multiple
factors in their queries.

On one of my older DB's, users would be prompted to enter the following to
get
the report they needed...

Between [Start Date] And [End Date]

I would like to have them enter only one date, and have the query show only
records on that specific date in their report. Isn't there anything I can
just enter
into the criteria of the query for this (meaning, change the "Between" and
"And" criteria)?

Thanks!
Karen
 
Hi Access Users. I've reviewed many of the questions previously answered
here but cannot find a simple answer - some of the questions require multiple
factors in their queries.

On one of my older DB's, users would be prompted to enter the following to
get
the report they needed...

Between [Start Date] And [End Date]

I would like to have them enter only one date, and have the query show only
records on that specific date in their report. Isn't there anything I can
just enter
into the criteria of the query for this (meaning, change the "Between" and
"And" criteria)?

Thanks!
Karen

As criteria on the date field, write:

[Enter the Date wanted]
 
Thanks Fred. This seems to error out on my report though - I get no results
when I enter 02/13/06 - when in fact, there are records for this date. Any
other thoughts?



fredg said:
Hi Access Users. I've reviewed many of the questions previously answered
here but cannot find a simple answer - some of the questions require multiple
factors in their queries.

On one of my older DB's, users would be prompted to enter the following to
get
the report they needed...

Between [Start Date] And [End Date]

I would like to have them enter only one date, and have the query show only
records on that specific date in their report. Isn't there anything I can
just enter
into the criteria of the query for this (meaning, change the "Between" and
"And" criteria)?

Thanks!
Karen

As criteria on the date field, write:

[Enter the Date wanted]
 
Thanks Fred. This seems to error out on my report though - I get no results
when I enter 02/13/06 - when in fact, there are records for this date. Any
other thoughts?

fredg said:
Hi Access Users. I've reviewed many of the questions previously answered
here but cannot find a simple answer - some of the questions require multiple
factors in their queries.

On one of my older DB's, users would be prompted to enter the following to
get
the report they needed...

Between [Start Date] And [End Date]

I would like to have them enter only one date, and have the query show only
records on that specific date in their report. Isn't there anything I can
just enter
into the criteria of the query for this (meaning, change the "Between" and
"And" criteria)?

Thanks!
Karen

As criteria on the date field, write:

[Enter the Date wanted]

Are you sure the dates are exactly 02/13/06 and not, for example,
02/13/06 08:10:15 AM?

If you have entered a time value (using Now() for instance) into the
date field than you cannot expect any return if you enter 02/13/06
except for those records dated exactly at midnight.
02/13/2006 00:00:00 is not the same as 2/13/2006 00:00:01 (one second
after midnight).

What you can do is:
Add a new column to the query grid:
Format([DateField],"mm/dd/yyyy")

Then as criteria for this new column, write:
Format([Enter the date],"mm/dd/yyyy")

which will return those records which include a time value.
It might be a good idea to get into the habit of using a 4 digit year.
 
fredg said:
Thanks Fred. This seems to error out on my report though - I get no results
when I enter 02/13/06 - when in fact, there are records for this date. Any
other thoughts?

fredg said:
On Tue, 28 Feb 2006 12:01:27 -0800, kalyhan wrote:

Hi Access Users. I've reviewed many of the questions previously answered
here but cannot find a simple answer - some of the questions require multiple
factors in their queries.

On one of my older DB's, users would be prompted to enter the following to
get
the report they needed...

Between [Start Date] And [End Date]

I would like to have them enter only one date, and have the query show only
records on that specific date in their report. Isn't there anything I can
just enter
into the criteria of the query for this (meaning, change the "Between" and
"And" criteria)?

Thanks!
Karen

As criteria on the date field, write:

[Enter the Date wanted]

Are you sure the dates are exactly 02/13/06 and not, for example,
02/13/06 08:10:15 AM?

If you have entered a time value (using Now() for instance) into the
date field than you cannot expect any return if you enter 02/13/06
except for those records dated exactly at midnight.
02/13/2006 00:00:00 is not the same as 2/13/2006 00:00:01 (one second
after midnight).

What you can do is:
Add a new column to the query grid:
Format([DateField],"mm/dd/yyyy")

Then as criteria for this new column, write:
Format([Enter the date],"mm/dd/yyyy")

which will return those records which include a time value.
It might be a good idea to get into the habit of using a 4 digit year.

I will try your suggestion. I do have the table's date field set to "Now()"
so the
date is automatically entered for the user. When I use "Between" and "And",
the query has been pulling the correct dates, so I guess I didn't think
"Now()" in the table would conflict.

Thanks again for your help!
Karen
 
Back
Top