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: 6966
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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm


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