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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:40:50+00:00 2026-06-02T18:40:50+00:00

I get data from my DB using cursor = db.query(WebLeadMaster, select, condition1=+conditionVal1+ and condition2=+ConditionVal2,null,

  • 0

I get data from my DB using

cursor = db.query("WebLeadMaster", select, "condition1="+conditionVal1+
" and condition2="+ConditionVal2,null, null, null, "RegistrationTime DESC");

I am getting the data in my cursor alright. To display the data, i use the following code:

    SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this, 
            R.layout.resultleadlookup, cursor, columns, to); 
    mAdapter.notifyDataSetChanged();
    lstResult.setAdapter(mAdapter);

So, I cannot modify the contents of the cursor. The sort query has condition “RegistrationTime” which is a String data type. As you can see in the image below, it is not in a proper sorted format. (not according to date-time).

What changes should i make in my code so that it would sort properly according to date-time?

expected output and actual output

If i alter my DB query, to look like

cursor = db.query("WebLeadMaster", select, "condition1="+conditionVal1+
" and condition2="+ConditionVal2,null, null, null, null);

it gives an ascending order. All i want it the descending order.

  • 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-02T18:40:52+00:00Added an answer on June 2, 2026 at 6:40 pm

    Well, i changed my table structure. I added another field “_id” to it. Set the property as AUTO INCREMENT to it, and sorted the list with respect to _id field.

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

Sidebar

Related Questions

I was using the exact same query to get data from two tables. when
I am using Cursor to get data from DB (it's information about the overlay
currently I am using ListActivity. I use a cursor to get the data from
Is it possible to get data from remote server using JUST TSQL? I mean
I am currently using this code to get data from a URL: NSURL *url
I need to get data from flat files to DB using SSIS . The
We are using C# and Linq2SQL to get data from a database for some
I am using jQuery to get data from server. Data is coming. Here what
I'm using LINQ to Get data from database table called table1 when using LINQ
I'm using an XSLTprocessor script to get data from an external source. Now I

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.