JSP SQL
I have the following SQL Statement. I use to use it in my ASP page, and it worked fine, but now that I try to use it in my JSP page, it give an error, what may be wrong?
SELECT DISTINCT CONVERT(CHAR(11), R_Date, 111) + SUBSTRING(CONVERT(CHAR(19), R_Date, 100), 13, 19) AS Expr1 FROM Rates Where R_DATE > '2004' ORDER BY Expr1 DESC
ERROR
HTTP ERROR: 500
ERROR: syntax error at or near ","
[423 byte] By [
Reniera] at [2007-10-1 23:41:26]

> what may be wrong?
well first of all you should remove the database access code from your JSP
IMHO, JSP's shouldn't have any code inside of them
that said, take the SQL and put it into a SQL command interpreter and try it there, once you get it working right, then move it over to Java
I am using PostgreSQL and JDBC / JNDI, using JSTL
The error says >
javax.servlet.jsp.JspException:
SELECT DISTINCT CONVERT(CHAR(11), R_Date, 111) + SUBSTRING(CONVERT(CHAR(19), R_Date, 100), 13, 19) AS Expr1 FROM Rates Where R_DATE > '2004' ORDER BY Expr1 DESC
: ERROR: syntax error at or near ","