You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Jack Lauman <jl...@nwcascades.com> on 2004/01/19 01:48:09 UTC
SQL / Date query
I'm trying to create a JSP page the will display rows of a table
beginning on the current date and ending at a total of 7 days.
The following query works in MySQL but returns the following error
when attempting to run the jsp:
org.apache.jasper.JasperException:
SELECT date, time, am_pm, height, cond
FROM cherry_point_tides
WHERE date BETWEEN CURDATE and CURDATE() + INTERVAL 6 DAY
: Column not found, message from server: "Unknown column 'CURDATE' in
'where clause'"
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
Re: SQL / Date query
Posted by Felipe Leme <ja...@felipeal.net>.
Hi Jack,
Looks like you forgot to user parentesis in the first CURDATE. Your WHERE
statement should be:
WHERE date BETWEEN CURDATE() and CURDATE() + INTERVAL 6 DAY
Regards,
Felipe
On Sunday 18 January 2004 22:48, Jack Lauman wrote:
> I'm trying to create a JSP page the will display rows of a table
> beginning on the current date and ending at a total of 7 days.
>
> The following query works in MySQL but returns the following error
> when attempting to run the jsp:
>
>
> org.apache.jasper.JasperException:
> SELECT date, time, am_pm, height, cond
> FROM cherry_point_tides
> WHERE date BETWEEN CURDATE and CURDATE() + INTERVAL 6 DAY
>
> : Column not found, message from server: "Unknown column 'CURDATE' in
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org