If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > timestamp_format problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-27-09, 10:01
vivek.vivek vivek.vivek is offline
Registered User
 
Join Date: Jan 2009
Posts: 27
Question 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
Reply With Quote
  #2 (permalink)  
Old 01-27-09, 21:07
nick.ncs nick.ncs is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 01-27-09, 23:07
vivek.vivek vivek.vivek is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 01-28-09, 00:26
nick.ncs nick.ncs is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On