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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:47:36+00:00 2026-06-14T22:47:36+00:00

I want to insert date,month,year and events in a table,and retrieve the event of

  • 0

I want to insert date,month,year and events in a table,and retrieve the event of a particular day, when the date is selected from a date picker!!

I have been searching about it, but got no convincing ideas!!

please if someone could help me out…

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-14T22:47:37+00:00Added an answer on June 14, 2026 at 10:47 pm

    Create the SQLite Database table by executing the query to create a new table according to your constraints.

    db.execSQL("CREATE TABLE "+employeeTable+" 
        ("+colID+" INTEGER PRIMARY KEY AUTOINCREMENT, "+
            colName+" TEXT, "+colAge+" Integer, "+colDept+" 
        INTEGER NOT NULL ,FOREIGN KEY ("+colDept+") REFERENCES 
        "+deptTable+" ("+colDeptID+"));");
    

    Use ContentValues to update/insert data in the table.

    SQLiteDatabase db=this.getWritableDatabase();
    ContentValues cv=new ContentValues();
       cv.put(colDeptID, 1);
       cv.put(colDeptName, "Sales");
       db.insert(deptTable, colDeptID, cv);
    
       cv.put(colDeptID, 2);
       cv.put(colDeptName, "IT");
       db.insert(deptTable, colDeptID, cv);
       db.close();
    

    and Cursor to retrieve data from the table.

    Cursor getAllDepts()
      {
       SQLiteDatabase db=this.getReadableDatabase();
       Cursor cur=db.rawQuery("SELECT "+colDeptID+" as _id, 
        "+colDeptName+" from "+deptTable,new String [] {});
    
       return cur;
      }
    

    Source : This tutorial explains everything in more detail.

    Disclaimer : This answer is only to help you understand how to work with SQLite (as you say that you haven’t been able to come across any convincing ideas). You would need to write your own code to handle the logic of retrieving the events according to the date selected in the DatePicker, but I think that should not be much of a problem.

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

Sidebar

Related Questions

I have an string that contains month/date and I need to insert the year.
I have table like this create table tbl_1( year int, month int, day int
I want to insert a record into a MySQL database table from a formulaire.
I already created a register form. I have 3 select-boxes. Day, Month, Year. In
I have a day, month and year in php variables. How can I use
I want to read the single day, month and year, without adding 3 extra
I want to insert some values from a table to another in a sql
i want to insert date & time to DateTimePicker. for example: date: 03/08/2009 time:
I want to insert a date record to an Access database. Here is my
I want to insert a date of the format YYYY-MM-DD which is entered by

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.