Page 1 of 1

Geting year from date column (Basic Queswtion)

Posted: Tue Feb 21, 2006 12:41 pm
by pedrotuga
How do i get a four digit number from a YYYY-MM-DD date stored in a database.

Whats the best way?

I am using a mysql db.

thx in advance

Posted: Tue Feb 21, 2006 12:42 pm
by feyd
YEAR(`column reference`)

Posted: Tue Feb 21, 2006 12:47 pm
by pedrotuga
lets see...


like

Year('date')

it gets the year from a date string right?

Posted: Tue Feb 21, 2006 12:59 pm
by josh
that's what he said..