Results 1 to 3 of 3

Thread: MySQL Functions

  1. #1
    Join Date
    Feb 2006
    Posts
    3

    Unanswered: MySQL Functions

    I can't get the following functions to work. Anyone know why?

    select subtime(endtime,starttime) from huntlog

    select substr(food,1,1) from huntlog

    MySQL spits back

    #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '( endtime , starttime ) from huntlog
    LIMIT 0, 30' at line 1


    It seems these functions don't want to work. Column names are valid. I've done selects on them, but the functions don't work. I can do

    select count(*) from huntlog

    Any help is appreciated.

    Thanks.

  2. #2
    Join Date
    Apr 2006
    Location
    Denver, Co. USA
    Posts
    242
    The most obvious question is what version of mysql are you using?

    From the mysql manual -
    SUBSTR() is a synonym for SUBSTRING(), added in MySQL 4.1.1.
    SUBTIME() was added in MySQL 4.1.1.

  3. #3
    Join Date
    Feb 2006
    Posts
    3

    Well....

    Here's the funny part (probably should've mentioned this earlier). I'm running 5.0.12 on my machine, but connect to a work server that's running an earlier version (3.XX) I believe. I'm going to assume 5.0.12 is getting confused somehow and referencing an .ini or .dll for the earlier version.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •