How can i actually detect the time as shown below?

If the user select the data from the database between 2008/06/05 12:00:00 and 2008/06/06 12:00:00 and the database type is varchar?

I can select that particular data out, but i need to further categorize it according to hours, like this:

If vDateTime.Hour >= 0 And vDateTime.Hour < 24 Then
                        Dim hour As Integer = vDateTime.Hour
                        If hour = 0 Then
                            hour = 24
                        End If

but the 2PM at 2008/06/05 will crash with 2PM at 2008/06/06
Thanks....

Anyone can help? Thanks

Hi,
Sorry ur problem may not be understandable. Please give more examples to understand ur problem

Hi,
Sorry ur problem may not be understandable. Please give more examples to understand ur problem

Em....
Lets say user can select a time to view the data he needs, for example, if he want to view data from 2008/05/30 12:00:00 to 2008/05/31 12:00:00, but i use the coding below:

If vDateTime.Hour >= 0 And vDateTime.Hour < 24 Then
                        Dim hour As Integer = vDateTime.Hour
                        If hour = 0 Then
                            hour = 24
                        End If

Hence those data within that particular hours will be grouped.
But now i am facing this problem:
2008/05/30 08:00:00 and 2008/05/31 08:00:00 will grouped together and consider as same but actually are of two different date, which i dont want in that way.
The idea i want is something like this:
For 2008/05/30:
08:00:00 .........
09:00:00 ........
23:59:59

For 2008/05/31:
08:00:00 .........
09:00:00 ........
23:59:59

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.