I am getting an Exception occurred error with this code and I don't understand why?
<%=tyears = year(date()) %>
<%=startyear = year(dbrs("hiredate") %>
<%=yrsofserv = tyears - startyear %>
<p><strong>Years of service = <% yrsofserv.value %><br>
When you use the = sign instead of a response.write, you are limited to writing only a single thing. Now, this could be anything from a single integer amount to the result of a mathematical function, or a single string variable to several concatenated together. The error is occuring because ASP doesn't know wether you are trying to response.write a variable or assign one. If you are trying to get a true/false answer, you will need to rewrite a bit more, if you are simply trying to print and assign in the same statement, you will need to break it up into seperate statements.
-Tarwn
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.