I am doing some calculations on an ASP page using a query in access that sums up certain columns. For some selections there is no data to sum up so the returning value is null or empty. The problem is I cannot get this to add with other values because it is non-numeric.
For example, I have the query qryTotals with the field 'total'.
If I try to set a variable varTotal = rs1("total") and rs1("total") is null or = "" then my next calculations don't work.
So..... I try and set the variable = 0 when rs1("total") = "" or rs1("total") is null
if rs1("total") = "" then varTotal = 0 end if
or
if rs1("total") = null then varTotal = 0 end if
However.... this does not work. The if then statement is never evaluated as being true for some reason.
Can someone tell me what I am doing wrong?
Thank you.
For example, I have the query qryTotals with the field 'total'.
If I try to set a variable varTotal = rs1("total") and rs1("total") is null or = "" then my next calculations don't work.
So..... I try and set the variable = 0 when rs1("total") = "" or rs1("total") is null
if rs1("total") = "" then varTotal = 0 end if
or
if rs1("total") = null then varTotal = 0 end if
However.... this does not work. The if then statement is never evaluated as being true for some reason.
Can someone tell me what I am doing wrong?
Thank you.