This topic is locked

Compare Two Values Afteredit

3/21/2013 1:40:22 AM
ASPRunnerPro General questions
A
adnankmk author

I have table reference with the following fields.
id (int)

name (varchar)

down (bit)

downdate (datetime)
I want after updating the value of each reference to check the status of the "down" field. if the value of "down" field is 1 then insert the current date in the "downdate" if the value of "down" is 0 then the field "downdate" left empty. I have written the following code using events and it gives the error.
if (values["Down"]==1)

{

values("DS_Down_Date")=now();

}

else

{

values("DS_Down_Date")=values ("")

}

Sergey Kornilov admin 3/21/2013

This doesn't look like correct code to me. Curly braces are not a part of VBScript. The mix of round and square brackets is unhealthy as well. My suggestion is to study examples in ASPRunnerPro manual in order to find the right syntax. You can also use syntax checker in Events Editor.
If I understand your question right your code is supposed to look like this:

if values("Down")=1 then

values("DS_Down_Date")=now()

else

values("DS_Down_Date")=""

end if