I pull numbers from a database and do calculations on them in an asp page. These calculations require I check for nulls, which I do by:
It seems to me there should be a more elegant way of doing this. I know the number field in the db shouldn't be allowing null values, and I could change it, but I want to keep that as a last resort.
Any suggestions?
Code:
if isnull(rs("Price")) then
varPrice=0
else
varPrice=rs("Price")
end if
It seems to me there should be a more elegant way of doing this. I know the number field in the db shouldn't be allowing null values, and I could change it, but I want to keep that as a last resort.
Any suggestions?