Jes Sie

Jes Sie

  • 740
  • 1.2k
  • 281.3k

Displaying null value to gridview from database

Jun 5 2018 11:39 PM
Hello everyone, I once again would like your assistance. I have this query below:
  1. SELECT  DISTINCT sg.StudentID,   
  2.                      (sm.Fname + ' ' + sm.Lname + ' - ' + sm.NickName) AS StudentName,  
  3.                       
  4.                      ISNULL(sg.Q1, 0) as Q1,  
  5.                      ISNULL(sg.Q2, 0) as Q2  
  6.   
  7.     FROM    dbo.tblStudentGradesTwoTerms sg INNER JOIN  
  8.         dbo.tblEnrollmentHeader eh ON sg.EnrollmentID = eh.EnrollmentID INNER JOIN  
  9.         dbo.tblStudentTeacherMaster sm ON sg.StudentID = sm.StudentTeacherID AND    eh.StudentID = sm.StudentTeacherID  
  10.       
  11.     WHERE   sg.SchoolCode = @SchoolCode AND   
  12.             sg.SchoolYear = @SchoolYear AND   
  13.             sg.GradeLvl = @GradeLvl AND   
  14.             sg.SubjectID = @SubjectCode  
and this is what it displays in my gridview:
 
 
How not to display the 0? I want to display only blank if students doesn't have grades yet.
Thanks for any assistance. 
 

Answers (1)