I just happen to be playing with some MySQL dbs with an interactive db  
client ---

I tried the syntax

>
> EXTRACT(WEEK FROM testdate)

and get the same error, while:

EXTRACT(DAY FROM testdate)

works fine

Checking the MySQL docs at:

http://webdocs.math.univ-rennes1.fr/MySQL/mysql-3.23.52/
manual_Date_and_time_functions.html

about 1/3 way down the page, shows the types supported for EXTRACT

Week is not mentioned.

However, MySQL does support

mysql> select WEEK('1998-02-20');
         -> 7

So that is likely the cause of confusion;

HTH

Dick

On Apr 4, 2004, at 8:21 AM, Jochem van Dieten wrote:

> JT said:
>  >
>  > <cfquery name="weekly" datasource="#application.ds#">
>  > SELECT   testdate
>  > FROM     completedtest
>  > WHERE    EXTRACT(WEEK FROM testdate) = EXTRACT(WEEK FROM
>  > CURRENT_DATE)
>  >          AND
>  >          EXTRACT(YEAR FROM testdate) = EXTRACT(YEAR FROM
>  > CURRENT_DATE)
>  > GROUP BY EXTRACT(DAY FROM testdate)
>  > </cfquery>
>  >
>  > The ERROR is :
>  >       Error Executing Database Query.
>  >       Syntax error or access violation: You have an error in your
>  > SQL syntax
>  > near 'WEEK FROM testdate) = EXTRACT(WEEK FROM CURRENT_DATE) AND EX'
>  > at line 3
>
>  I think you would have to take this up with MySQL, since it should
>  work according to the manual:
>  http://www.mysql.com/doc/en/Date_and_time_functions.html
>
>  Jochem
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to