use calendar control in unbound form

W

Walter

I have a query that reads a date field:

Between [Forms]![pickdate]![fromdate] And [Forms]![pickdate]![todate]

The fromdate and todate values come from a calendar control in an unbound
form. However, the todate is not inclusive as there are missing records. Any
ideas would be great.
 
M

Michel Walsh

Hi,


Add 1 to todate since by default, the time is, say, at 00:00:00 as in July
17, 2006 at 00:00:00. So, July 17, 2006, 06:00:00 is AFTER the limit you
supplied. Adding 1 (day = 24 hour) correct the situation.

Between [Forms]![pickdate]![fromdate] And CDate([Forms]![pickdate]![todate])
+ 1



Hoping it may help,
Vanderghast, Access MVP
 
W

Walter

Thanks for the prompt reply, Michael.

The query formula makes sense but still does not work. Funny thing is the
query returns all records if I use a textbox to capture the fromdate and
todate.

I checked the properties in the calendar box but did not see any relevant
paramenter.


Michel Walsh said:
Hi,


Add 1 to todate since by default, the time is, say, at 00:00:00 as in July
17, 2006 at 00:00:00. So, July 17, 2006, 06:00:00 is AFTER the limit you
supplied. Adding 1 (day = 24 hour) correct the situation.

Between [Forms]![pickdate]![fromdate] And CDate([Forms]![pickdate]![todate])
+ 1



Hoping it may help,
Vanderghast, Access MVP

Walter said:
I have a query that reads a date field:

Between [Forms]![pickdate]![fromdate] And [Forms]![pickdate]![todate]

The fromdate and todate values come from a calendar control in an unbound
form. However, the todate is not inclusive as there are missing records.
Any
ideas would be great.
 
Top