Legent Mady

Legent Mady

  • NA
  • 41
  • 12.9k

divide by zero error encountered

Mar 15 2017 2:38 PM
i am using vs2015 and ms sql..
 
my database table definition on:
                                                       
[REG_NO] VARCHAR (50) NOT NULL,
[NAME] VARCHAR (25) NULL,
[ROLL_NO] VARCHAR (10) NULL,
[DOB] VARCHAR (50) NULL,
[COURSE] VARCHAR (10) NULL,
[DEPARTMENT] VARCHAR (20) NULL,
[YEAR] NVARCHAR (10) NULL,
[SHIFT] VARCHAR (10) NULL,
[IMAGE] IMAGE NULL,
[PRESENTEDHOURS] FLOAT (53) NULL,
[TOTALHOURS] FLOAT (53) NULL,
PRIMARY KEY CLUSTERED ([REG_NO] ASC)
 
 
i will add a column on :
 
                         [PERCENTAGE] AS (([PRESENTED HOURS]/[TOTAL HOURS])*(100)),
  now my table definition is
[REG_NO] VARCHAR (50) NOT NULL,
[NAME] VARCHAR (25) NULL,
[ROLL_NO] VARCHAR (10) NULL,
[DOB] VARCHAR (50) NULL,
[COURSE] VARCHAR (10) NULL,
[DEPARTMENT] VARCHAR (20) NULL,
[YEAR] NVARCHAR (10) NULL,
[SHIFT] VARCHAR (10) NULL,
[IMAGE] IMAGE NULL,
[PRESENTEDHOURS] FLOAT (53) NULL,
[TOTALHOURS] FLOAT (53) NULL,
[PERCENTAGE] AS (([PRESENTED HOURS]/[TOTAL HOURS])*(100)),
PRIMARY KEY CLUSTERED ([REG_NO] ASC)
 
 then run................
 
error message on .......
  divide error encountered by zero
  
 
 
 
 
 
                                    

Answers (2)