IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Get the max timestamp value without microseconds part


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Fri Oct 09, 2009 10:51 am
Reply with quote

Hi,

Please let me know the query to get the timestamp without microseconds part.

Select *

from table 1

where timestamp = (
select max(timestamp)
from table 1
where condition1))
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Fri Oct 09, 2009 11:06 am
Reply with quote

When you fetch it then you can trim it or use SUBSTR
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Oct 09, 2009 3:01 pm
Reply with quote

depends on the actual requirement :
Code:
select
current_timestamp - microsecond(current_timestamp) microseconds
,substr(char(current_timestamp),1,19)
from sysibm.sysdummy1


1st : rounded down to the second still type = TimeStamp
2nd : substr ( like ketan said)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
No new posts Timestamp difference and its average ... DB2 11
No new posts To get previous month from current ti... SYNCSORT 7
No new posts Calculate with timestamp PL/I & Assembler 19
Search our Forums:

Back to Top