End Date in Qry not being inclusive

jedder18

Just Livin the Dream!
Local time
Today, 12:08
Joined
Mar 28, 2012
Messages
135
I'm using Acces 2007

Created a query with a parameter of Between [StartDate] and [EndDate] on a date/time field.
If person selects between 03/01/2015 and 03/31/2015 any records with 03/31/2015 are not selected.
Isn't the End Date inclusive in the parameter?

It's been awhile since I used Access. I don't remember having this problem before and I've made tons of parameter queries with dates.
Any help, much appreciated.
 
Check your date field for a time component. If it has one, everything beyond midnight on 3/31 is later than 3/31. If you populate with Now() instead of Date(), you have a time component.
 
It is a date/time field and populated with Date() and formatted for short date
 
Can you attach the db here?
 
It has client data in it and would be a hippa violation....
 
Understandable. Add a field to your query:

DateValue(YourFieldName)

and put the criteria on that and see what happens.
 
I ended up having to use the datadd +1 function.
It must be Access updates or something. I don't ever remember having to do this before. It was always inclusive.
 
I'm willing to bet there's a time component in your data. Do a select query on that field and see if the "Whatever" field includes decimal values:

SELECT FieldName, CDbl(FieldName) AS Whatever
FROM TableName
WHERE FieldName Between [StartDate] and [EndDate]
 

Users who are viewing this thread

Back
Top Bottom