|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
ORDER BY Problems
Right, here's the deal:
I have two posts of data submitted to the database. They're both written on the same date, but at different times. When I return these posts for viewing, I use: ORDER BY post_date DESC However, this does not order in terms of most recent TIME. Can anybody shed any light on this for me? Kind thanks in advance!
__________________
<%Questions of Science%> |
|
#2
|
|||
|
|||
|
What datatype is post_date?
|
|
#3
|
|||
|
|||
|
DateTime
NOT ShortDateTime |
|
#4
|
|||
|
|||
|
Well, in that case your query should work. I don't really have any bright ideas regarding this. Could you give some example?
|
|
#5
|
|||
|
|||
|
examples
something like....
select * from tbl_posts ORDER BY post_date That doesn't seem to return the most recent TIME. So I mean if I have 2 posts on the same day, they don't necessarily appear in the correct order. A mystery ![]() |
|
#6
|
|||
|
|||
|
select * from tbl_posts
ORDER BY post_date, post_time That should work for you. And this is a stupid mention, but i always add it just change the post_time that i added to your time field's name |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > ORDER BY Problems |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|