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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:26:20+00:00 2026-06-19T01:26:20+00:00

I am getting error in my sql Query and what are things i need

  • 0

I am getting error in my sql Query and what are things i need to change to improve my coding

My Code is

My DBHelper Code

public Cursor fetchDaysAppointment(String from, String to){

    Cursor c = ourDatabase.rawQuery("SELECT * FROM "+CUSTOMER_TABLE_NAME+
            "WHERE (aDate >= ? AND aDate <= ?)", 
            new String[]{from, to});

    if(c != null){
        c.moveToFirst();
    }
    return c;
}

My Java Code

public void getDaysAppointment(int day, int month, int year){

    String from = year+"-"+month+"-"+day+" 00:00:00";
    String to = year+"-"+month+"-"+day+" 23:59:59";

    in.open();
    cursor = in.fetchDaysAppointment(from, to);
    cursor.moveToFirst();

    for(int i=0; i<cursor.getCount(); i++){

        if(cursor.getInt(cursor.getColumnIndex("aTime")) == 8){
            System.out.println("Hi the value is found to be Matched");
        }
        cursor.moveToNext();

    }

}

Log cat Error

02-14 17:23:06.740: E/AndroidRuntime(4535): FATAL EXCEPTION: main
02-14 17:23:06.740: E/AndroidRuntime(4535): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ashadegreen/com.example.ashadegreen.Home}: android.database.sqlite.SQLiteException: near "(": syntax error: , while compiling: SELECT * FROM customerWHERE (aDate >= ? AND aDate <= ?)
  • 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-19T01:26:21+00:00Added an answer on June 19, 2026 at 1:26 am

    You forgot to add space before WHERE.

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

Sidebar

Related Questions

I'm getting a timeout error when trying to execute a LINQ (-to-SQL) query System.Data.SqlClient.SqlException:
I am getting the following error when try to save. SQL Query: INSERT INTO
I am getting this error when i use a string array java.lang.NullPointerException The code
Hey guys getting this syntax error on my sql query: '#1064 - You have
I am getting error in the sql statement. (server= RAJ-PC\SQLEXPRESS; user id=sa; password=as64ws; database=onlineshopping,
Getting error while inserting values into database (SQL Server 2008) Implicit conversion from data
Im getting an error with my SQL queries in PHP. I have tried multiple
I'm getting error while using replace in an update statement in sql server 2008.
I am getting an Error in MySQL: You have an error in your SQL
I'm getting the error below for this SQL statement in VB.Net 'Fill in the

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.