Between Dates

  • Thread starter Thread starter Grant
  • Start date Start date
G

Grant

Hello,

I have the following criteria in my query on a date..

Between Forms![Report Menu]![Start Date] and Forms![Report
Menu]![End Date].

If I put in today's date for example.. no records are
returned.. How should this qry be written to get just
today?

Thanks
Grant
 
Grant,

I prefer to write the criteria as
= datevalue(Forms![Report Menu]![Start Date]) and <
(datevalue(Forms![Report Menu]![End Date])+1)

This way I don't have to worry about the time portion
which is stored as the decimal portion of the date/time.

Mark
-----Original Message-----
Hello,

I have the following criteria in my query on a date..

Between Forms![Report Menu]![Start Date] and Forms! [Report
Menu]![End Date].

If I put in today's date for example.. no records are
returned.. How should this qry be written to get just
today?

Thanks
Grant

.
 
Thanks so much.. Worked great!
-----Original Message-----
Grant,

I prefer to write the criteria as
= datevalue(Forms![Report Menu]![Start Date]) and <
(datevalue(Forms![Report Menu]![End Date])+1)

This way I don't have to worry about the time portion
which is stored as the decimal portion of the date/time.

Mark
-----Original Message-----
Hello,

I have the following criteria in my query on a date..

Between Forms![Report Menu]![Start Date] and Forms! [Report
Menu]![End Date].

If I put in today's date for example.. no records are
returned.. How should this qry be written to get just
today?

Thanks
Grant

.
.
 
Hello,

I have the following criteria in my query on a date..

Between Forms![Report Menu]![Start Date] and Forms![Report
Menu]![End Date].

If I put in today's date for example.. no records are
returned.. How should this qry be written to get just
today?

Thanks
Grant

How about entering today's date in the [Start Date] control and
tomorrow's date in the [End Date] control.

Or change the query parameter to:*
forms!ReportMenu![Start Date]

* One thing to consider is whether a time value has been included in
the field. If the parameter entered is 5/27/2004, and the field
includes a time value, no records will be returned for this date
UNLESS the time value is exactly midnite (00:00:00 AM). If the time
has been included in the field, you should use between 5/27/2004 and
5/28/2004 to get todays records.
 
Back
Top