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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:35:49+00:00 2026-05-16T16:35:49+00:00

My following sql query giving me the following error, What does it mean. Am

  • 0

My following sql query giving me the following error, What does it mean. Am i defining the alias fir column in wring way. Please help me out with this.
My error is this and i am putting query just below the error.

Error in SELECT clause: expression near 'Year'.
Missing FROM clause.
Unable to parse query text.



SELECT [tbl_students].passing_year as Passing Year,[tbl_branch].branch_name as Branch_Name FROM [tbl_students], [tbl_course], [tbl_branch] WHERE [tbl_students].course_id=@courseId 
                        AND   [tbl_students].branch_id IN(64) 
                        AND   [tbl_students].course_id=[tbl_course].course_id AND [tbl_students].branch_id=[tbl_branch].branch_id                        
                        AND  (@firstYrPercent is null OR [tbl_students].first_year_percent>=@firstYrPercent)
                        AND  (@secondYrpercent is null OR [tbl_students].second_year_percent>=@secondYrPercent)
                        AND  (@thirdYrPercent is null OR[tbl_students].third_year_percent>=@thirdYrPercent)
                        AND  (@finalYearpercent is null OR [tbl_students].final_year_percent>=@finalYearpercent)
                        AND  (@currentDegeePercentage is null OR [tbl_students].current_degree_percent>=@currentDegeePercentage)
                        AND  (@passoutYear is null OR [tbl_students].passing_year>=@passoutYear) 
                        AND  (@currentBacklog is null OR [tbl_students].current_backlog=@currentBacklog)
                        AND  (@sex is null OR [tbl_students].gender=@sex) 
                        AND  (@eGap is null OR [tbl_students].gapin_education<=@eGap)
                        AND  (@highSchoolPercentge is null OR [tbl_students].highschool_percentage>=@highSchoolPercentge)
                        AND  (@higherSchoolPercentage is null OR [tbl_students].ssc_percentage>=@higherSchoolPercentage)
                        AND  (@grauationPercentage is null OR [tbl_students].graduation_percentage>=@grauationPercentage)
                        AND  (@diplomaPercentage is null OR [tbl_students].diploma_percentage>=@diplomaPercentage)
                        AND  (@noOfAtkt is null OR [tbl_students].number_of_ATKT<=@noOfAtkt)
                        AND  (@validDate is null OR [tbl_students].DOB>=@validDate)
  • 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-05-16T16:35:50+00:00Added an answer on May 16, 2026 at 4:35 pm

    You need to escape your Passing Year column with square brackets (see first line):

    SELECT [tbl_students].passing_year as [Passing Year],
           [tbl_branch].branch_name    as Branch_Name 
    FROM  [tbl_students], [tbl_course], [tbl_branch] 
    WHERE [tbl_students].course_id=@courseId 
    AND   [tbl_students].branch_id IN(64) 
    AND   [tbl_students].course_id=[tbl_course].course_id AND [tbl_students].branch_id=[tbl_branch].branch_id                        
    AND  (@firstYrPercent is null OR [tbl_students].first_year_percent>=@firstYrPercent)
    AND  (@secondYrpercent is null OR [tbl_students].second_year_percent>=@secondYrPercent)
    AND  (@thirdYrPercent is null OR[tbl_students].third_year_percent>=@thirdYrPercent)
    AND  (@finalYearpercent is null OR [tbl_students].final_year_percent>=@finalYearpercent)
    AND  (@currentDegeePercentage is null OR [tbl_students].current_degree_percent>=@currentDegeePercentage)
    AND  (@passoutYear is null OR [tbl_students].passing_year>=@passoutYear) 
    AND  (@currentBacklog is null OR [tbl_students].current_backlog=@currentBacklog)
    AND  (@sex is null OR [tbl_students].gender=@sex) 
    AND  (@eGap is null OR [tbl_students].gapin_education<=@eGap)
    AND  (@highSchoolPercentge is null OR [tbl_students].highschool_percentage>=@highSchoolPercentge)
    AND  (@higherSchoolPercentage is null OR [tbl_students].ssc_percentage>=@higherSchoolPercentage)
    AND  (@grauationPercentage is null OR [tbl_students].graduation_percentage>=@grauationPercentage)
    AND  (@diplomaPercentage is null OR [tbl_students].diploma_percentage>=@diplomaPercentage)
    AND  (@noOfAtkt is null OR [tbl_students].number_of_ATKT<=@noOfAtkt)
    AND  (@validDate is null OR [tbl_students].DOB>=@validDate)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please tell me what I am missing. the following sql query returns
The following line is giving an error message. $query = 'SELECT * FROM products
I am trying to export the following data in the query from ms sql
I got the following trigger on my sql server 2008 database CREATE TRIGGER tr_check_stoelen
I have the following sql statement: start_time = ADDDATE(start_time, INTERVAL $minuteDelta MINUTE), end_time =
I have a SQL Server 2000 DTS package. One of the steps of this
I am trying to insert a row into a table, using a value that
Drupal version 6.12 I have a page whose input format is PHP. I simply
I am trying to perform tuning of materialized views in my application. I set
I was reading other questions posted and found many examples to retrieve last month

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.