2010-09-04 3 views
0

Мой следующий запрос sql дает мне следующую ошибку: что это значит. Я определяю псевдоним столбца псевдонимов. Пожалуйста, помогите мне с этим. Моя ошибка такова, и я помещаю запрос чуть ниже ошибки.Ошибка SQL Query при определении псевдонима для столбца

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][email protected] 
         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>[email protected]) 
         AND (@secondYrpercent is null OR [tbl_students].second_year_percent>[email protected]) 
         AND (@thirdYrPercent is null OR[tbl_students].third_year_percent>[email protected]) 
         AND (@finalYearpercent is null OR [tbl_students].final_year_percent>[email protected]) 
         AND (@currentDegeePercentage is null OR [tbl_students].current_degree_percent>[email protected]) 
         AND (@passoutYear is null OR [tbl_students].passing_year>[email protected]) 
         AND (@currentBacklog is null OR [tbl_students][email protected]) 
         AND (@sex is null OR [tbl_students][email protected]) 
         AND (@eGap is null OR [tbl_students].gapin_education<[email protected]) 
         AND (@highSchoolPercentge is null OR [tbl_students].highschool_percentage>[email protected]) 
         AND (@higherSchoolPercentage is null OR [tbl_students].ssc_percentage>[email protected]) 
         AND (@grauationPercentage is null OR [tbl_students].graduation_percentage>[email protected]) 
         AND (@diplomaPercentage is null OR [tbl_students].diploma_percentage>[email protected]) 
         AND (@noOfAtkt is null OR [tbl_students].number_of_ATKT<[email protected]) 
         AND (@validDate is null OR [tbl_students].DOB>[email protected]) 
+0

Не могу я дать разрыв во имя Alīses столбцов SQL запроса в осины. сеть – NoviceToDotNet

ответ

2

Вам нужно бежать ваш Уходящий год колонки квадратных скобках (см первую строку):

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][email protected] 
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>[email protected]) 
AND (@secondYrpercent is null OR [tbl_students].second_year_percent>[email protected]) 
AND (@thirdYrPercent is null OR[tbl_students].third_year_percent>[email protected]) 
AND (@finalYearpercent is null OR [tbl_students].final_year_percent>[email protected]) 
AND (@currentDegeePercentage is null OR [tbl_students].current_degree_percent>[email protected]) 
AND (@passoutYear is null OR [tbl_students].passing_year>[email protected]) 
AND (@currentBacklog is null OR [tbl_students][email protected]) 
AND (@sex is null OR [tbl_students][email protected]ex) 
AND (@eGap is null OR [tbl_students].gapin_education<[email protected]) 
AND (@highSchoolPercentge is null OR [tbl_students].highschool_percentage>[email protected]) 
AND (@higherSchoolPercentage is null OR [tbl_students].ssc_percentage>[email protected]) 
AND (@grauationPercentage is null OR [tbl_students].graduation_percentage>[email protected]) 
AND (@diplomaPercentage is null OR [tbl_students].diploma_percentage>[email protected]) 
AND (@noOfAtkt is null OR [tbl_students].number_of_ATKT<[email protected]) 
AND (@validDate is null OR [tbl_students].DOB>[email protected])