Re: assignment of data into a 2 dimensional array

From: Date: Mon, 03 May 2004 20:27:25 +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-185249@lists.php.net to get a copy of this message
Still doesn't work man, distinct isn't working properly, it still counts each swipe of the card, not discrete swipes. Thats what I'm trying to do this in PHP :) It doesn't work, its still using distinct on whatever mssql's NOW()-myssql function is before it does the date conversion, even tho that would be wrong and not following the order of operations...i guess...I dunno, all i can tell you is it doesn't work. it doesn't give the correct number when I do count(cardnum) on the dates. On Mon, 3 May 2004, Mattias Thorslund wrote: > > >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 (#185249) next »