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 All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts Sort card to know that creation date ... DFSORT/ICETOOL 10
No new posts Help with SORT - I need to validate d... DFSORT/ICETOOL 11
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
No new posts Sorting Date Field DFSORT/ICETOOL 4
Search our Forums:


Back to Top