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 8810691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:10:49+00:00 2026-06-14T03:10:49+00:00

I have developed an App ..For that I have a database and it has

  • 0

I have developed an App ..For that I have a database and it has many tables. One of the table has date column.
My question is I have to sort the dates and have to pick oldest one Like Oct-24-2012 from below table column

Column_Date
————

Nov-07-2012
Nov-21-2012
Nov-25-2012
Oct-25-2012
Oct-24-2102

How should I do that….I have stored the date column in string… If I need to change the datatype for date Column, Let me know which Datatype should i used. And How Should I sort the Column.According to That datatype..

  • 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-06-14T03:10:50+00:00Added an answer on June 14, 2026 at 3:10 am

    In sqlite does not really have a date type. You can store dates as strings using one of their predefined formats see http://www.sqlite.org/lang_datefunc.html for more information.

    A time string can be in any of the following formats:

    YYYY-MM-DD
    YYYY-MM-DD HH:MM
    YYYY-MM-DD HH:MM:SS
    YYYY-MM-DD HH:MM:SS.SSS
    YYYY-MM-DDTHH:MM
    YYYY-MM-DDTHH:MM:SS
    YYYY-MM-DDTHH:MM:SS.SSS
    HH:MM
    HH:MM:SS
    HH:MM:SS.SSS
    now
    DDDDDDDDDD
    

    You need to store them in YYYY-MM-DD then you can sort them order by asc limit 1 to get the oldest date.
    So instead of

    Column_Date
    ------------
    Nov-07-2012
    Nov-21-2012
    Nov-25-2012
    Oct-25-2012
    Oct-24-2102
    

    You will have to store them like this instead

    Column_Date
    ------------
    2012-11-07
    2012-11-21
    2012-11-25
    2012-10-25
    2012-10-24
    

    Finally you read the rows if any

    Cursor oldestDateCursor = db.query("DateTableName", null, null, null, null, null, "date_column ASC LIMIT 1");
    if (oldestDateCursor.moveToFirst())
    {
        String date = oldestDateCursor.getColumnName(oldestDateCursor.getColumnIndex("date_column"));
    }
    oldestDateCursor.close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed an app that in testing has worked fine but when it
I have developed a C# app that overrides the PreviewMouseUp, PreviewMouseMove, and PreviewMouseDown events
I have a nice clean domain layer in my app that was developed in
I have a standard php app that uses SQL Server as the back-end database.
I`ve an app that use sqlite for storage. In this database I have a
I have a web app that runs fine in Visual web developer. But when
http://developer.android.com/tools/publishing/app-signing.html I have a keystore that I already have an alias and password for.
I have to develop an App for Android tablets that demands printing files to
I have to develop web2py app and have to use Facebook sdk in that.
I have an app that I want to develop for Android 2.1, 2.2, 2.3.3,

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.