Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6775935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:57:58+00:00 2026-05-26T15:57:58+00:00

I have a table in MSAccess, which is generated from another software. In that

  • 0

I have a table in MSAccess, which is generated from another software. In that table, there a colmn with date/time elements. Here is a short content:

day,month,year,hour,minute 
1,3,2011,17,21
1,2,2011,18,33

The task is to build MSAccess SQL, which order rows by date/time formed with that data. Is there a way to do that without convert all to seconds?

Thank you in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:57:58+00:00Added an answer on May 26, 2026 at 3:57 pm

    There are several ways to do it without converting to a proper date/time format, but they will all be dog slow. If it is at all possible to convert that field to a proper date/time field (or even add an extra field to hold the properly formatted date/time) then you should do that and be sure that the field is indexed.

    If you are truly constrained and have to deal with the table as is, the most straightforward way to do it would be to write a function that translates that string to a date/time and sort by that function.

    Here’s a quick sample function:

    Function ConvertDateTime(dt As String) As Date
    Dim Flds As Variant
        Flds = Split(dt, ",")
        ConvertDateTime = DateSerial(Flds(2), Flds(1), Flds(0)) + _
                          TimeSerial(Flds(3), Flds(4), 0)
    End Function
    

    Then your query would include the following Order By clause:

    ORDER BY ConvertDateTime([day,month,year,hour,minute])
    

    EDIT: Your question is a bit ambiguous as currently asked. If you actually have five separate columns, then the sorting is straightforward: ORDER BY [Year], [Month], [Day], [Hour], [Minute]
    I assumed that was not the case or you would have easily figured that out on your own.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query in MS Access which creates a table from two subqueries.
I have a table named OT Hours which has the following column EmpId, Date,
I have a legacy MS Access 2007 table that contains 52 fields (1 field
I have a ms access database that has one table for each photo album
Have a linking (or ref) table which has a dual primary key. Need to
I have a database with a table which is full of conditions and error
I have table named Table X which contains some names and their corresponding age,
I have an MS Access database that contains a table of dates, scores and
I have a column called DayShift in a table which is of Yes/No data
I have a query I'm designing which grabs data from multiple different tables. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.