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 Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm

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