Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exception occurred error

Status
Not open for further replies.

sthmpsn1

MIS
Sep 26, 2001
456
US
I am getting an Exception occurred error with this code and I don't understand why?
<%=tyears = year(date()) %>
<%=startyear = year(dbrs(&quot;hiredate&quot;)) %>
<%=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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top