View previous topic :: View next topic
|
Author |
Message |
sureshbabu.jv
New User
Joined: 11 Apr 2006 Posts: 41 Location: Chennai
|
|
|
|
I want to get YYYYMMDD format from system in DB2 whenver i use Accept date function.
Thanks
Suresh |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
Hi,
ANSWER
SELECT CHAR(CURRENT DATE,ISO) AS iso ==> 2005-11-30
,CHAR(CURRENT DATE,EUR) AS eur ==> 30.11.2005
,CHAR(CURRENT DATE,JIS) AS jis ==> 2005-11-30
,CHAR(CURRENT DATE,USA) AS usa ==> 11/30/2005
FROM sysibm.sysdummy1;
I think this helps you
Please correct me if I am Wrong |
|
Back to top |
|
|
getdpk
New User
Joined: 06 Feb 2006 Posts: 2
|
|
|
|
Please use the following
Accpet WS-CURRENT-DATE FROM DATE YYYYMMDD
Thanks,
Deepak [/quote] |
|
Back to top |
|
|
krish_mrt
New User
Joined: 15 Apr 2005 Posts: 12 Location: Chennai
|
|
|
|
Hi,
if you want the format exactly as you have specified, then you can try this...
Code: |
select
year(<timestamp_value>)||
case
when month(<timestamp_value>)> 9 then ''||month(<timestamp_value>)
when month(<timestamp_value>)< 10 then '0'||month(<timestamp_value>)
end ||
case
when day(<timestamp_value>)> 9 then ''||day(<timestamp_value>)
when day(<timestamp_value>)< 10 then '0'||day(<timestamp_value>)
end
from sysdummy1 |
|
|
Back to top |
|
|
|