Sorting an Access Query on Date and Time DESC

I run an Access query on a table that sorts data by Date just fine, but I would like to sort it by Date and Time. The Date and Time are in separate columns.  Presently the results look like this;

4/9/2010       2:10 AM          (253) 292-xxxx          (951) 719-xxxx         Sent          --
4/9/2010       2:32 AM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       10:41 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       10:53 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       11:27 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:28 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       11:34 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:35 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       11:36 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:37 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       11:43 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:43 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:45 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       11:46 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:47 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --

My SQL to pull these results looks like this;

strSQL = "SELECT * FROM Phone WHERE Message_To = '951719xxxx' AND Message_From = '253292xxxx' OR Message_From = '951719xxxx' AND Message_To = '253292xxxx' ORDER BY Message_Date DESC, Message_Time"

What I would like the results to be has the Time DESC by latest time for the Date, like this;

4/9/2010       2:32 AM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/9/2010       2:10 AM          (253) 292-xxxx          (951) 719-xxxx         Sent          --
4/8/2010       11:47 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       11:46 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:45 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       11:43 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:43 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:37 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       11:36 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:35 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       11:34 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:28 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       11:27 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       10:53 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       10:41 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --

I don't want to use a temp table and the result is posted on a .asp page.

<edited by SouthMod 04/10/2010 to obfuscate phone numbers in SELECT statement>
LVL 18
mgfranzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jppintoCommented:
strSQL = "SELECT * FROM Phone WHERE Message_To = '951719xxxx' AND Message_From = '253292xxxx' OR Message_From = '951719xxxx' AND Message_To = '253292xxxx' ORDER BY Message_Date DESC, Message_Time DESC"

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mgfranzAuthor Commented:
Almost, but the results came out like this;

...
4/8/2010        5:25 PM           (951) 719-xxxx           (253) 292-xxxx          Received          --
4/8/2010       5:23 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       5:22 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       5:21 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       5:11 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:47 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       11:46 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:45 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       11:43 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:43 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:37 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --
4/8/2010       11:36 PM         (951) 719-xxxx         (253) 292-xxxx        Received        --
4/8/2010       11:35 PM         (253) 292-xxxx         (951) 719-xxxx        Sent        --

Could the SQL be interpreting the time as a sequential number from 9 - 0?
0
jppintoCommented:
It can be interpreting the time as text...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.