Doesn't work, mssql doesn't have a DATE_FORMAT function. you have to use mssql's convert() function.
Oh, sorry for assuming MySQL... :-) Actually, I've done a lot more MS SQL than MySQL, anyway.
On MS SQL, try:
Convert(char(8), your_date, 112) as formatted_date
112 is the "style" identifier for ISO dates with 4 digist for the year: YYYYMMDD.
Check out MS SQL's books online on "CAST and CONVERT" for the rest of the "style" codes if you'd like a different format.
Doing this kind of stuff in the DB should be a lot cleaner and easier to maintain. Depending on your optimization, with indexes and such, it can be quicker, too.
/Mattias