Thanks in advance
Yogi
1
----------
2008-02-07
1 record(s) selected.
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
> Hi,
> I am working on a database that has a variable with timestamp
> values. I wanted to convert the variable from timestamp to yyyy-mm-dd
> format.
select
varchar_format (your_column_name, 'YYYY-MM-DD HH24:MI:SS')
from
your_table
and for an export statement use sth like
EXPORT TO my_file OF DEL MODIFIED BY COLDEL;
TIMESTAMPFORMAT=\"dd.mm.yyyy hh:mm\"
select * from foo
--
Toralf Förster
pgp key 0x7DB69DA3
I'm sure you can adapt this to get the function you need
CREATE FUNCTION FFF.DATE3( fec DATE )
RETURNS varchar(11)
------------------------------------------------------------------------
-- SQL UDF (Scalar)
------------------------------------------------------------------------
F1: BEGIN ATOMIC
RETURN SUBSTR(DIGITS(DAY(fec)),9,2) || '-' ||
SUBSTR('EneFebMarAbrMayJunJulAgoSepOctNovDic',MONTH(fec)*3-2,3) || '-' ||
SUBSTR(DIGITS(YEAR(fec)),7,4);
END
Diego
"yogi" <yog...@gmail.com> wrote in message
news:d512b805-60a2-4ea7...@i7g2000prf.googlegroups.com...