View Single Post
  #9 (permalink)  
Old 06-25-2009, 6:04 AM
JohnH's Avatar
JohnH JohnH is offline
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2005
Location: Norway
Age: 37
Posts: 10,329
Reputation: 1315
JohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond repute
Default

Why would you convert DTP.Value anyway? It already returns a Date value, the return type is DateTime which is a Date.

Note that time is always a part of the Date value, if you want to reset the time part to 0 (midnight) you can use the Date property; DTP.Value.Date.

Since you query items with a single Date parameter you also have to make sure the Date values in your database is normalized to time 0 in a similar fashion, else you will find no records because the time part of the Date value would differ. If this is not possible you have to query a Date range that includes any time of that day.
__________________
Reply With Quote