IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to get Month of any date in DB2


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
Search our Forums:

Back to Top