In MySQL you can do that with: DATE_FORMAT
DATE_FORMAT (column_name,'%Y-%m-%d %H:%i')
-Mensaje original-
De: J S [mailto:[EMAIL PROTECTED]
Enviado el: Miércoles, 14 de Julio de 2004 08:26 a.m.
Para: [EMAIL PROTECTED]
Asunto: sql function for timestamp
Hi,
What SQL function do I need
.
- Eve
-Original Message-
From: Chinchilla Zúñiga, Guillermo [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 14, 2004 11:54 AM
To: J S; [EMAIL PROTECTED]
Subject: RE: sql function for timestamp
In MySQL you can do that with: DATE_FORMAT
DATE_FORMAT (column_name,'%Y-%m-%d %H:%i
If you have 4.1.1 or greater, you can use GET_FORMAT( timestamp, 'ISO'
).
Otherwise, I think if you just use DATE_FORMAT( timestamp, '%Y-%m-%d
%H:%i ) you will get weird values if your timestamp field doesn't
include seconds. So, either alter your field to be CONCAT( timestamp,
'00' ), or, as
Thanks for your help. I would like to do it with the SQL. However I'm still
having problems with the syntax below.
Is this wrong?
mysql SELECT DATE_FORMAT (20040601123456,'%Y-%m-%d');
ERROR 1064: You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server
JS:
When I use DATE_FORMAT(), if I have a space character between
DATE_FORMAT and the ( I get an error. Try writing it like:
SELECT DATE_FORMAT( 20040601123456, '%Y-%m-%d' );
MySQL v4.1.2-alpha-standard
Mac OS X
Wes
On Jul 14, 2004, at 12:20 PM, J S wrote:
Thanks for your help. I would like to
That was it! Thanks so much.
JS
JS:
When I use DATE_FORMAT(), if I have a space character between DATE_FORMAT
and the ( I get an error. Try writing it like:
SELECT DATE_FORMAT( 20040601123456, '%Y-%m-%d' );
MySQL v4.1.2-alpha-standard
Mac OS X
Wes
On Jul 14, 2004, at 12:20 PM, J S wrote:
Thanks