Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us