Access 97 date range query

  • Thread starter Thread starter arnoldo calvo
  • Start date Start date
A

arnoldo calvo

I'm having a few issues working with MS Access queries,
becuase if I want to search for a dated range information,
the data included within the last query day, will not
appear, you must increased by at least one day your date
range to view all the data.
Do you know if this's a micorsoft problem?
 
Hi Arnoldo,
I think the key is the content of the date value versus
your parameter value. If the date value was created using
the Now() function or in any way includes clock time, the
the date value includes the date PLUS a fraction of a day
representing the clock time. If your parameter references
JUST the date, then it equals midnight of that day and
will be less than the date value you're trying to extract.
Therefore, your parameter referencing an end-of-range
day must be set forward a day to catch the fractions.

Hope this helps.
 
It's not an Access problem in the least. If you're storing Date and Time in
a field, it's not reasonable to assume that only providing a Date will
retrieve all of the rows. If you've stored Date and Time and you only want
to work with the Date portion of the value, you can use the DateValue
function. However, it's far more efficient to simply look for everything
less than the next day.
 
I'm not storing date/time, I'm just including a date when
I will out an specific registry, it's not even automathic,
we're typing it, ie. 07/28/04.
 
If you've only got dates with no times, then BETWEEN x AND y should give
you all records including those with dates of x and y.
 
Back
Top