View previous topic :: View next topic
|
Author |
Message |
mrunalini sripada
New User
Joined: 26 Sep 2008 Posts: 4 Location: Hyderabad
|
|
|
|
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 |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
I guess you mean SELECT when you say PRINT.
Another point...do you know the SQL basics? |
|
Back to top |
|
|
mrunalini sripada
New User
Joined: 26 Sep 2008 Posts: 4 Location: Hyderabad
|
|
|
|
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 |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
and what about the year? |
|
Back to top |
|
|
VVRAVINDRA
New User
Joined: 04 Aug 2008 Posts: 46 Location: Chennai
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
mrunalini sripada
New User
Joined: 26 Sep 2008 Posts: 4 Location: Hyderabad
|
|
|
|
Hello all,
I got the issue resolved . Thanks |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
Please share the solution if you can ..
-Ad |
|
Back to top |
|
|
mrunalini sripada
New User
Joined: 26 Sep 2008 Posts: 4 Location: Hyderabad
|
|
|
|
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 |
|
|
|