Between dates gone wrong (1 Viewer)

intrep11

Registered User.
Local time
Today, 14:34
Joined
Apr 6, 2003
Messages
63
Why is this not working can anyone say

i have a query that i am specifying a date range using a form with the following criteria in the query

Between forms!formname!startdate And forms!formname!enddate

my problem is if i have record on the same date as the end date they dont show up

ie i have 4 sets of trial data entered for the date 18/06/03 and if i set the end date to 18/06/03 they dont show up in the query if i set the date to 19/06/03 they do

what have i done wrong ???? this cant be a flaw in the programme can it.
 

FoFa

Registered User.
Local time
Today, 08:34
Joined
Jan 29, 2003
Messages
3,672
Date time is stored, but if you do not specify a time, it defaults to 00:00:00, so your between is doing
WARNING, US DATE FORMATS IN EFFECT
Between 06/15/02 00:00:00 AND 06/18/03 00:00:00

But you have a date of 06/18/03 14:33:56, and that IS outside your date range, so youo either need to specify a time of 23:59:59, or what I usually do is add 1 day to the end date and use that so it is less than (or equal to) 06/19/03 00:00:00 and that usually works fine.
 
R

Rich

Guest
Define the query Parameters as Date/Time
 

intrep11

Registered User.
Local time
Today, 14:34
Joined
Apr 6, 2003
Messages
63
thanks

thanks of the education so the dates look right in the reports i have simply added +1 to the end of the between criterial

ie
Between [Forms]![frmReportpicker]![Start Date] And [Forms]![frmReportpicker]![End Date]+1

it now works a treat cheers
 

Users who are viewing this thread

Top Bottom