From: Martin Gainty Date: April 9 2010 4:04pm Subject: RE: DATE_FORMAT parameter question List-Archive: http://lists.mysql.com/mysql/221193 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="_a3f738e4-b0ba-4730-a456-9a231da0cd0e_" --_a3f738e4-b0ba-4730-a456-9a231da0cd0e_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable (Agradecimentos para o conselho) Eu espero que o homem respons=E1vel parar=E1 a chuva e permitir=E1 a todos = n=F3s a oportunidade de dessecar e apreciar a luz do sol Obrigado! Martin Gainty=20 ______________________________________________=20 Por favor n=E3o altere/interrompa ou altere esta transmiss=E3o > To: mysql@stripped > From: joao@stripped > Subject: Re: DATE_FORMAT parameter question > Date: Fri=2C 9 Apr 2010 12:56:46 -0300 >=20 > Basicay=2C your date_format works like: >=20 > select DATE_FORMAT('YY-MM-DD'=2C'%y-%b-%d') from DUAL=3B >=20 > "Martin Gainty" escreveu na mensagem=20 > news:BLU142-W2137936B18AE273DBD6CB1AE150@stripped... >=20 > Good Afternoon All >=20 >=20 > following the documentation available at >=20 > http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html >=20 > i wish to select a date using DD-MON-YY format but my format of '%y-%b-%d= '=20 > appears to be incorrect >=20 >=20 >=20 > mysql> select DATE_FORMAT('11-10-09'=2C'%y-%b-%d') from DUAL=3B > +------------------------------------+ > | DATE_FORMAT('11-10-09'=2C'%y-%b-%d') | > +------------------------------------+ > | 11-Oct-09 | > +------------------------------------+ > 1 row in set (0.00 sec) >=20 >=20 >=20 > mysql> show variables like "%VERSION%"=3B > +-------------------------+------------------------------+ > | Variable_name | Value | > +-------------------------+------------------------------+ > | protocol_version | 10 | > | version | 5.1.25-rc-community-log | > | version_comment | MySQL Community Server (GPL) | > | version_compile_machine | ia32 | > | version_compile_os | Win32 | > +-------------------------+------------------------------+ > 5 rows in set (0.00 sec) >=20 >=20 > it seems when i follow the documentation which states %d is used for day = and=20 > %y is year i see: > mysql> select DATE_FORMAT('11-10-09'=2C'%d-%b-%y') from DUAL=3B > +------------------------------------+ > | DATE_FORMAT('11-10-09'=2C'%d-%b-%y') | > +------------------------------------+ > | 09-Oct-11 | >=20 >=20 >=20 > but if i switch %y and %d in date_format I get the correct result e.g. >=20 > mysql> select DATE_FORMAT('11-10-09'=2C'%y-%b-%d') from DUAL=3B > +------------------------------------+ > | DATE_FORMAT('11-10-09'=2C'%y-%b-%d') | > +------------------------------------+ > | 11-Oct-09 | > +------------------------------------+ > 1 row in set (0.00 sec) >=20 >=20 > any ideas on what I am doing wrong with format string to produce desired= =20 > DD-MON-YY format? >=20 >=20 >=20 > Many Thanks=2C > Martin Gainty > ______________________________________________ > Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de confidentialit= =E9 >=20 > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene=20 > Empfaenger sein=2C so bitten wir hoeflich um eine Mitteilung. Jede unbefu= gte=20 > Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht= =20 > dient lediglich dem Austausch von Informationen und entfaltet keine=20 > rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von=20 > E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. >=20 > Ce message est confidentiel et peut =EAtre privil=E9gi=E9. Si vous n'=EAt= es pas le=20 > destinataire pr=E9vu=2C nous te demandons avec bont=E9 que pour satisfair= e=20 > informez l'exp=E9diteur. N'importe quelle diffusion non autoris=E9e ou la= copie=20 > de ceci est interdite. Ce message sert =E0 l'information seulement et n'a= ura=20 > pas n'importe quel effet l=E9galement obligatoire. =C9tant donn=E9 que le= s email=20 > peuvent facilement =EAtre sujets =E0 la manipulation=2C nous ne pouvons a= ccepter=20 > aucune responsabilit=E9 pour le contenu fourni. >=20 >=20 >=20 > _________________________________________________________________ > Hotmail is redefining busy with tools for the New Busy. Get more from you= r=20 > inbox. > http://www.windowslive.com/campaign/thenewbusy?ocid=3DPID28326::T:WLMTAGL= :ON:WL:en-US:WM_HMP:042010_2=20 >=20 >=20 >=20 > --=20 > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dmgainty@stripped= om >=20 =20 _________________________________________________________________ Hotmail is redefining busy with tools for the New Busy. Get more from your = inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=3DPID28326::T:WLMTAGL:O= N:WL:en-US:WM_HMP:042010_2= --_a3f738e4-b0ba-4730-a456-9a231da0cd0e_--