Home Forums General Discussions Open Topic trimming the date

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #47155

    Anthony
    Participant

    i have a DATE column in a db.
    YYYY-MM-DD
    2002-02-24

    i’d like to trim off the month and date, only returning YYYY.

    and i’m using php/mysql

    #103573

    Bucky Ramone
    Participant

    Maybe you can use mySQL’s DATE_FORMAT() (using the %Y format) :roll:

    #103574

    Anthony
    Participant

    i was trying to do it a la php, but this works fine.
    just adds another column to the results returned:

    SELECT mp3_album.album_year, YEAR(mp3_album.album_year) AS album_year_2,

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.