Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Posts
    27

    Question Unanswered: timestamp_format problem

    Help me to convert the timestamp, where am passing it as an input value (format : 12/7/2007 00:00:00)in procedure

    'CREATE VIEW DBO.Step45_Flap1 AS
    select * from (
    select time_stamp,
    ' || CHAR(query1) ||',ROW_NUMBER() OVER (ORDER BY time_stamp DESC)
    as RN from '||Param5||'
    where time_stamp '||CHAR(Param4)||' TIMESTAMP_FORMAT(Param3,''MM-DD-YYYY HH24:MIS''))group by time_stamp)';


    Thanks in Advance
    Vivek

  2. #2
    Join Date
    May 2007
    Location
    somewhere in dbforums
    Posts
    221
    shouldn't ''MM-DD-YYYY HH24:MIS'' be 'YYYY-MM-DD HH24:MIS'
    IBM Certified Database Associate, DB2 9 for LUW

  3. #3
    Join Date
    Jan 2009
    Posts
    27
    But my input date format is MM/DD/YYYY
    I changed that to YYYY-MM-DD. But is showing error in time format

  4. #4
    Join Date
    May 2007
    Location
    somewhere in dbforums
    Posts
    221
    the problem is not with MM DD YYYY.... check the hour:min:second format
    it should be
    HH24 : MI : SS (without the spaces of course else it'll turn to a smiley )
    and not HH24:MIS
    IBM Certified Database Associate, DB2 9 for LUW

Posting Permissions

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