dimanche 23 décembre 2018

Condition in SQL compute column

I've created a table in SQL server which store batsman run and ball-faced count, in addition to it I had a computed column to get players strike rate

(((100)*[TotalRun])/[TotalBallPlayed])

its work fine unless if first ball become invalide and player score run against it Ex. TotalRun = 2 TotalBallPlayed =0 (as ball was noball)

then this compute column create exception resulting an error in the program

is there any way to add a condition in the computed column to avoid that situation?

Aucun commentaire:

Enregistrer un commentaire