Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Print information from a table using a month from the date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Print information from a table using a month from the date
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    Post subject:
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    Post subject: Reply to: query on date in db2
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    Post subject:
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Wed Oct 29, 2008 2:48 pm    Post subject:
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    Post subject: Reply to: Print information from a table using a month from
Reply with quote

Hello all,

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

Senior Member


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

PostPosted: Thu Oct 30, 2008 11:26 am    Post subject:
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    Post subject: Reply to: Print information from a table using a month from
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    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 Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts Reg:Displaying the particular month o... bhavana yalavarthi All Other Mainframe Topics 4 Sat Jul 08, 2017 8:13 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us