Danish Habib

Danish Habib

  • NA
  • 694
  • 245.5k

whats wrong with this query i am bind a gridview but it give

Aug 12 2015 3:23 AM
When binding a gridview query gives syntax error 
SELECT SUM(ISNULL(QT.QuestionTarget,0)+ISNULL(QT.QT_FormMen,0)+ISNULL(QT.QT_ForWomen,0)+ISNULL(QT.QT_ForGirl,0)+ISNULL(QT.QT_ForBoy,0)) AS TARGETTOTAL,
QT.QuestionTarget As Target,QT.Question_ID,Q.QuestionText,AN.QTotal As Achieved,QT.QT_ForWomen AS TW,AN.id,QT.QT_FormMen AS TM,AN.QT_ForMen AS AM,AN.QT_ForWomen AS AW,QT.QT_ForGirl AS TG,AN.QT_ForGirl AS AG,QT.QT_ForBoy AS TB,AN.QT_ForBoy AS AB,V.VillageName,AN.CdfPErsonName,QT.District,AN.Year,
AN.Quarter,D.DistrictName ,QU.Quarter_Name,CC.CommunityCodeName,G.Group_Name,Y.Year_Name,AN.Date_Created,
AN.UserTypes,AN.AnswerID,U.IsActive,AN.Status from AnswersNew AN
INNER JOIN QuestionTarget QT ON QT.Question_ID= AN.Question_ID AND QT.Year=AN.Year AND QT.Quarter=AN.Quarter AND AN.DistrictId=QT.District
INNER JOIN Villages V ON V.VlgID=AN.VillagesId
INNER JOIN Quarter Qu ON Qu.Quarter_ID=AN.Quarter
INNER JOIN Users U ON U.UserId=AN.CDF_ID
INNER JOIN Questions Q ON Q.QuestionIds=QT.Question_ID
INNER JOIN CommunityCodes CC ON CC.CommunityCodeID =AN.CommunityCodes
INNER JOIN Groups G ON G.Group_ID=AN.UserTypes
INNER JOIN Year Y ON Y.YEAR_ID=AN.Year
INNER JOIN Districts D on D.DistrictId=U.DistrictId
WHERE U.IsVisible = 1 '
 

Answers (3)