Results 1 to 2 of 2

Thread: date function

  1. #1
    Join Date
    Dec 2003
    Posts
    14

    Unanswered: date function

    i got a small question.
    BEG_DATE is a timestamp data type(YYYY-MM-DD HH:MMS) .
    I need the HH:MMS part to be truncated.

    I am using SELECT to_date(BEG_DATE,'YYYY-MM-DD') from Table;
    does'nt work.
    Thanks,
    Mark.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Timestamp has more detail beyond HH:MMS, but if you just want the date portion of a timestamp, you can use:

    DATE(BEG_DATE)

    If the date does not come out in the format you want, check the CHAR function which allows you to specity it as USA, ISO, etc.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •