Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How Do i get date format YYYYMMDD or MMDDYYYY.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
sureshbabu.jv

New User


Joined: 11 Apr 2006
Posts: 41
Location: Chennai

PostPosted: Mon May 15, 2006 8:03 pm    Post subject: How Do i get date format YYYYMMDD or MMDDYYYY.
Reply with quote

I want to get YYYYMMDD format from system in DB2 whenver i use Accept date function.

Thanks
Suresh
Back to top
View user's profile Send private message

shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

PostPosted: Mon May 15, 2006 8:31 pm    Post subject:
Reply with quote

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
View user's profile Send private message
getdpk

New User


Joined: 06 Feb 2006
Posts: 2

PostPosted: Tue May 16, 2006 11:54 am    Post subject: Re: How Do i get date format YYYYMMDD or MMDDYYYY.
Reply with quote

Please use the following

Accpet WS-CURRENT-DATE FROM DATE YYYYMMDD

Thanks,
Deepak [/quote]
Back to top
View user's profile Send private message
krish_mrt

New User


Joined: 15 Apr 2005
Posts: 12
Location: Chennai

PostPosted: Thu May 25, 2006 3:25 pm    Post subject: Re: How Do i get date format YYYYMMDD or MMDDYYYY.
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sum the fields in particular format f... sharana64 DFSORT/ICETOOL 9 Fri Jan 05, 2018 1:11 am
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Format Last Record differently from r... Learncoholic DFSORT/ICETOOL 5 Tue Oct 24, 2017 12:01 pm
No new posts Format issues using XMITIP MSGDD ssdjp1 CLIST & REXX 5 Mon Oct 23, 2017 8:47 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us