Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Time Picker ACTIVEX Control Problem

Status
Not open for further replies.

BriceR

Programmer
Sep 20, 2001
9
0
0
AU
I have a problem when using this control in a From/To type report or query. Using code >= Forms!Reports!FromDate AND <= Forms!Reports!ToDate should return the range of dates between and including both fields. It does not however return the date in the from field (only dates greater than) - ie its ignoring the = operator. This does not happen if I use Text boxes for the date fields. Has anyone had this experience and knows whether it is a problem with this ActiveX control and if there is a fix etc.
 
What is the ActiveX control?

If you are using the Date and time picker control you will need to have a look at the time properties(It will always defualt in the time you created the control). Is the data you are trying to qry have a time stamp?

 
Thanks for getting back - The control is the Date Time Picker. The problem is not the default date - it is the fact that when the value selected in the date time picker is used as a query paramenter using >= it only returns values greter than not =. ie if I select 01/04/2002 in the picker the dates returned by the query are 2/04/2002 onwards. If I want 01/04/2002 onwards I have to pick 31/03/2002. If I am using >= in query I should not have to do this.
 
Thanks for getting back - The control is the Date Time Picker. The problem is not the default date - it is the fact that when the value selected in the date time picker is used as a query paramenter using >= it only returns values greter than not =. ie if I select 01/04/2002 in the picker the dates returned by the query are 2/04/2002 onwards. If I want 01/04/2002 onwards I have to pick 31/03/2002. If I am using >= in query I should not have to do this.



 
I would bet that it is also giving a time, thus making the date equal to the start date really < then the start date. So maybe it isn't returning 2/04/2002, it is returning 2/04/2002 12:00:00 or whatever.
2/04/2002 00:00:00 is not >= 2/04/2002 12:00:00.

Look into that, and make sure it isn't giving a time as well as a date.

HTH!

-Brad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top