Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005
    Posts
    5

    Unanswered: Showing month where expression is now()

    Hi,

    The answer to the question is probably very easy, still I can't find the answer. I've read the manual about date and time functions in MYSQL.

    It shows a lot of examples like 'select month('1998-02-01')' which gives '02' as result.

    What I want now is to select the month from the current date. In theory, the query should be something like 'select month('curdate()') but unfortunately, that doesn't work.

    My question is, what should the query be?

  2. #2
    Join Date
    Apr 2005
    Location
    Baltimore, MD
    Posts
    297
    Use DATE_FORMAT:
    Code:
    SELECT DATE_FORMAT( NOW() , "%c" )
    http://dev.mysql.com/doc/refman/5.0/...functions.html

Posting Permissions

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