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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:05:50+00:00 2026-06-01T16:05:50+00:00

I am new to android development. I been working on this for one day

  • 0

I am new to android development. I been working on this for one day and i couldn’t figure out whats the exact problem is because my query is running without error but no result.

My database query Value of formattedDate

 Calendar c = Calendar.getInstance();  

    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); 

    String formattedDate = df.format(c.getTime());

  public Cursor paymentWeek(Activity activity)
    {

         String[] from = { _PAYMENTID, NAME, REQUESTEDDATE, FROMAD, TOADD, EMAILBODYPAYMENT, AMOUNT};  

         SQLiteDatabase db = getReadableDatabase(); 

         String orderby = REQUESTEDDATE+" DESC";   

         Cursor cursor = db.rawQuery("SELECT * FROM " + PAYMENTTABLE+ " WHERE " + REQUESTEDDATE + " BETWEEN date('"+formattedDate+"') AND date('"+formattedDate+"','-7 days')", null);

         activity.startManagingCursor(cursor);

         return cursor;  
    }

My database date type is TEXT. i am storing in the format of (yyyy-mm-dd),eg:2012-04-07

But the problem is i can retrieve all datas from the database but if i want to retrieve values for last 7 days it doesn’t show any values.

It would be great if any alternatives available? and tip how to go for it?

Thanks…

  • 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-01T16:05:51+00:00Added an answer on June 1, 2026 at 4:05 pm

    as you say, your date type is TEXT, i dont think you can use between x and y to make the filter to return the content from x to y .

    you can try this: http://www.roseindia.net/sql/sql-between-date.shtml or http://www.techonthenet.com/sql/between.php .

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

Sidebar

Related Questions

I'm breaking my head over this one. I'm kind of new in android development.
I'm new to android development and I've been working on android through java(eclipse) till
I am new to android development, I apologize that similar questions has been asked
I am also new to Java and Android Development, been making a simple game
I am new to Android development and facing a problem while using AndEngine. I
I am new to Android development and i have been asked to create an
I am new to Android development and I have a problem that I have
I'm new to android game development. I currently working on a simple android app
I am very new to android development and have been trying to draw a
I'm new to Android development, and I've been playing around with it a bit.

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.