SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Zealot Makavely's Avatar
    Join Date
    Jul 2004
    Location
    Romania
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    tiny mysql problem

    SELECT x
    FROM y WHERE DATEPART(n, date_from_table) = DATEPART(n, GETDATE())

    it doesn't work..
    i try to use CURDATE() instead of GETDATE() but it doesn't work either.

  2. #2
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The mysql analog of DATEPART() is EXTRACT()

    http://dev.mysql.com/doc/mysql/en/da...functions.html


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
  •