I have a little problem with a query. I’m selecting data using the between command, But when I select the initial date equal to the final date the query doesn’t show data.
I know that the problem is the format. In my database I got something like this:2009-05-22 15:32:52.000. But when I send the date parameter from ASP.NET Page I sent only the Date (2009-05-22).
So, I want to fix this thing. I cannot change the Datetime inside the database.
I was thinking adding 1 day to the final date, So when the user select the same date I change the range behind the scene and then show the data. What do you think?
What would you do?
When I need to get all results for a day I create a DateTime with no time component (0:00) and then add a day and subtract a second to get a DateTime with a time component of 23:59:59. The DateTime class in .NET makes this pretty easy.