Facebook   Twitter    e-mail newsletter    YouTube    RSS Feed    Android App    iPhone and iPad App     BlackBerry App    


Results 1 to 7 of 7

Thread: SQL GETDATE()

  1. #1

    Default SQL GETDATE()

    Please help a noob here

    So I got a fairly basic understanding of SQL. I have an Afrihost hosting packing with SQL 5.1. In PhpMyAdmin I run a simple query SELECT NOW() and it returns a result. However when I run SELECT GETDATE() I get the following error: #1305 - FUNCTION dbname_db.GETDATE does not exist

    Should the results be the same?

    I'm suspecting that this database doesn't have a lot of functions?

    Thanks
    Last edited by Patty; 08-08-2012 at 11:17 AM.

  2. #2

    Default

    MySQL doesnt have the function GetDate().

    http://dev.mysql.com/doc/refman/5.5/...functions.html

  3. #3

    Default

    You can use CURRENT_TIMESTAMP ()
    Last edited by GarethC; 08-08-2012 at 03:08 PM.
    blog

    "You have brains in your head, and feet in your shoes, you can steer yourself in any direction you choose"

  4. #4

    Default

    Thanks for reply! So where does GetDate() come from then, because I often come across it on the net being used within SQL?

  5. #5

    Default

    Its actually part of Transact SQL which will only work on Microsoft SQL (MSSQL)

    http://msdn.microsoft.com/en-us/library/ms188383.aspx

  6. #6

    Default

    Quote Originally Posted by Ianvn View Post
    Its actually part of Transact SQL which will only work on Microsoft SQL (MSSQL)

    http://msdn.microsoft.com/en-us/library/ms188383.aspx
    This.

    MySQL and MS SQL are 2 totally different programs

  7. #7

Bookmarks

Bookmarks

Posting Permissions

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