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 to get Month of any date in DB2

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

New User


Joined: 25 Jul 2006
Posts: 23

PostPosted: Tue Feb 13, 2007 10:46 pm    Post subject: How to get Month of any date in DB2
Reply with quote

Hi,

I know that MONTH (CURRENT DATE) will give me the value of the month of that current date.

But if I want to get the month of 2006-12-31 the command
MONTH(2006-12-31) does not work and it gives an SQLCODE of -171
which is THE DATA TYPE, LENGTH, OR VALUE OF ARGUMENT nn OF function-name IS INVALID.

Can you somebody suggest.

Ragha
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Wed Feb 14, 2007 12:30 am    Post subject: Re: How to get Month of any date in DB2
Reply with quote

Ragha


Put the date in quotes

MONTH('2006-12-31')
Back to top
View user's profile Send private message
gragha

New User


Joined: 25 Jul 2006
Posts: 23

PostPosted: Wed Feb 14, 2007 12:31 am    Post subject: Re: How to get Month of any date in DB2
Reply with quote

Thanks, I just realized it.
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 Cobol program till a given time or fo... ankita agarwal COBOL Programming 7 Fri May 18, 2018 2:24 pm
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 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

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