Question : GETDATE and GETUTCDATE does not exist in MySQL

I've got a web application that works well with MS-SQL 2000 and MS-SQL 2005 databases.
I've copied the database to My SQL 5.0 successfully.

However I'm getting errors on the GETUTCDATE() and GETDATE() functions.

SQL >  update WORKUSERS set LOGINCOUNT=(LOGINCOUNT+1),LOGINDATE=getutcdate() where USERID='xxxx';

[MySQL][ODBC 3.51 Driver][mysqld-5.0.67.d7-ourdelta-log]FUNCTION workdb01.getutcdate does not exist

so I thought perhaps there was something wrong with my SQL syntax...  so I tried with the brackets, withut brackets, uppercase, lowercase, etc:

getutcdate
getutcdate()
GETUTCDATE
GETUTCDATE()
 
getdate
getdate()
GETDATE
GETDATE()
 
and no matter what I try I get a MySQL error.

What am I doing wrong?

Answer : GETDATE and GETUTCDATE does not exist in MySQL

Here are the MySql functions that should solve your problem:

UTC_DATE()
UTC_TIME()
UTC_TIMESTAMP()

CURDATE()
NOW() [date/time]
TIMESTAMP()

Here's a link with more MySql Date/Time Functions:

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html

Random Solutions  
 
programming4us programming4us