Get week from date

Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.

Moderators: Kalicharan, Moderator Group

Post Reply
chechir
Member
Posts: 3
Joined: Wed Mar 12, 2008 7:01 pm

Get week from date

Post by chechir » Tue Jul 22, 2008 12:53 am

hi,

How i can get the week from a date?.

Example:
"
Select datepart(Week, DateField)
from tablex

return--> week 35
"

Thanks in advance

User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

Post by Krishna » Fri Jul 25, 2008 12:27 pm

---------+---------+---------+----
SELECT WEEK(CURRENT_DATE)
FROM SYSIBM.SYSDUMMY1
---------+---------+---------+----

---------+---------+---------+----
30

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others