Re: assignment of data into a 2 dimensional array

From: Date: Mon, 03 May 2004 20:17:31 +0000
Subject: Re: assignment of data into a 2 dimensional array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-185247@lists.php.net to get a copy of this message
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

« previous php.general (#185247) next »