date range using datetimepicker

S

Souris

I have 2 date time picker on my form and use those 2 controls in my query
like following.

Select myField from MyTable
Where MyDate between [forms]![MyForm]![dtp1] and [forms]![MyForm]![dtp2]

It seems to return the records between 2 date time range,but not date range.
Date time picker keeps date and time value.
It does not return any records if I use same date like Apr/08/2008 and
Apr/08/2008.

It returns 2 days information if I enter Apr/07/2008 and Apr/08/2008.

My question is it possible to use date time picker for any date ranges?

Your information is great appreciated,
 
S

strive4peace

If you want JUST the date, try this:

Where DateValue(MyDate) between cDate([forms]![MyForm]![dtp1]) and
cDate([forms]![MyForm]![dtp2])

Warm Regards,
Crystal

*
:) have an awesome day :)
*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top