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

Print information from a table using a month from the date


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mrunalini sripada

New User


Joined: 26 Sep 2008
Posts: 4
Location: Hyderabad

PostPosted: Tue Oct 21, 2008 4:47 pm
Reply with quote

Hello

how to print information from a table using a month from the date column ex: jan from 25/01/97. This is not using a cobol program , using only db2 statements in spufi.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue Oct 21, 2008 5:11 pm
Reply with quote

I guess you mean SELECT when you say PRINT.

Another point...do you know the SQL basics?
Back to top
View user's profile Send private message
mrunalini sripada

New User


Joined: 26 Sep 2008
Posts: 4
Location: Hyderabad

PostPosted: Tue Oct 21, 2008 5:30 pm
Reply with quote

hello

yes , print i meant is to select. I think I found the answer

select from <table>
where month(colomn) = 1


Is this correct?
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue Oct 21, 2008 5:46 pm
Reply with quote

and what about the year?
Back to top
View user's profile Send private message
VVRAVINDRA

New User


Joined: 04 Aug 2008
Posts: 46
Location: Chennai

PostPosted: Wed Oct 29, 2008 1:33 pm
Reply with quote

Hi mrunalini sripada,

Your query and the question is a bit ambigious vague. Could throw some more light on your SQL query and the question you asked.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Oct 29, 2008 2:48 pm
Reply with quote

suggest you look at the case statement. you can use that to generate 'months'.

i believe that the iso(<date-column>) will also generate different date formats.
Back to top
View user's profile Send private message
mrunalini sripada

New User


Joined: 26 Sep 2008
Posts: 4
Location: Hyderabad

PostPosted: Thu Oct 30, 2008 9:39 am
Reply with quote

Hello all,

I got the issue resolved . Thanks
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Oct 30, 2008 11:26 am
Reply with quote

Hi,

Please share the solution if you can ..

-Ad
Back to top
View user's profile Send private message
mrunalini sripada

New User


Joined: 26 Sep 2008
Posts: 4
Location: Hyderabad

PostPosted: Mon Nov 03, 2008 11:03 am
Reply with quote

Ex :
SELECT * FROM SALES_ORDER_TRNG413
WHERE MONTH(S_ORDER_DT) = 1;

the above example will display results where month is Jan.
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top