ADSM-L

Re: [ADSM-L] Remove the Trailing .000000 in date_time

2015-07-03 06:37:30
Subject: Re: [ADSM-L] Remove the Trailing .000000 in date_time
From: "Loon, EJ van (ITOPT3) - KLM" <Eric-van.Loon AT KLM DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Fri, 3 Jul 2015 06:56:53 +0000
Hi guys!
Does anybody know how to remove the .000000 in the output from the SQL down 
below? Kurt gave a suggestion, but I don't know how to embed it in the SQL 
statement...
Thanks for your help in advance!
Kind regards,
Eric van Loon
AF/KLM Storage Engineering

-----Original Message-----
From: Loon, EJ van (ITOPT3) - KLM 
Sent: woensdag 1 juli 2015 17:08
To: ADSM-L AT VM.MARIST DOT EDU
Subject: RE: Trailing .000000

Hi Kurt!
Your SQL does indeed return the output I'm looking for, but how dow I embed it 
in the following SQL statement?

select actlog.date_time, actlog.nodename as "Nodename", actlog.message as 
"Message", nodes.node_name, nodes.contact from nodes,actlog where nodes.contact 
like 'Component Team Windows%%' and actlog.nodename=nodes.node_name and 
actlog.originator='CLIENT' and actlog.severity <> 'I' and 
cast(timestampdiff(16, current_timestamp - actlog.date_time) as decimal(4,1))<= 
2 group by actlog.nodename, actlog.date_time, actlog.message, nodes.node_name, 
nodes.contact order by actlog.nodename

Again, thanks for your help!
Kind regards,
Eric van Loon
AF/KLM Storage Engineering


-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] On Behalf Of 
BEYERS Kurt
Sent: woensdag 1 juli 2015 15:57
To: ADSM-L AT VM.MARIST DOT EDU
Subject: Re: Trailing .000000

Hi Eric,

It's always fun to play and calculate with timestamps in db2, here is one of 
the solutions to get the desired format:

tsm: TSMLABO3>select date_time from actlog fetch first 2 rows only

                  DATE_TIME
---------------------------
 2015-03-27 07:06:10.000000
 2015-03-27 07:06:10.000000

tsm: TSMLABO3>select varchar_format (date_time, 'YYYY-MM-DD HH24:MI:SS') as 
date_time from actlog fetch first 2 rows only

DATE_TIME: 2015-03-27 07:06:10
DATE_TIME: 2015-03-27 07:06:10

Regards,
Kurt

-----Oorspronkelijk bericht-----
Van: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] Namens Loon, 
EJ van (ITOPT3) - KLM
Verzonden: woensdag 1 juli 2015 15:17
Aan: ADSM-L AT VM.MARIST DOT EDU
Onderwerp: [ADSM-L] Trailing .000000

Hi guys!
Now that I have my SQL statement working I noticed that a select date_time from 
actlog returns the following format:

2015-06-29 23:27:04.000000

What is the proper way to remove the trailing .000000?
Again, thanks for your help!!!
Kind regards,
Eric van Loon
AF/KLM Storage Engineering

********************************************************
For information, services and offers, please visit our web site: 
http://www.klm.com. This e-mail and any attachment may contain confidential and 
privileged material intended for the addressee only. If you are not the 
addressee, you are notified that no part of the e-mail or any attachment may be 
disclosed, copied or distributed, and that any other action related to this 
e-mail or attachment is strictly prohibited, and may be unlawful. If you have 
received this e-mail by error, please notify the sender immediately by return 
e-mail, and delete this message.

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its 
employees shall not be liable for the incorrect or incomplete transmission of 
this e-mail or any attachments, nor responsible for any delay in receipt.
Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch 
Airlines) is registered in Amstelveen, The Netherlands, with registered number 
33014286
********************************************************

*** Disclaimer ***
Vlaamse Radio- en Televisieomroeporganisatie Auguste Reyerslaan 52
1043 Brussel

nv van publiek recht
BTW BE 0244.142.664
RPR Brussel
VRT Gebruikersvoorwaarden <http://www.vrt.be/gebruiksvoorwaarden>
********************************************************
For information, services and offers, please visit our web site: 
http://www.klm.com. This e-mail and any attachment may contain confidential and 
privileged material intended for the addressee only. If you are not the 
addressee, you are notified that no part of the e-mail or any attachment may be 
disclosed, copied or distributed, and that any other action related to this 
e-mail or attachment is strictly prohibited, and may be unlawful. If you have 
received this e-mail by error, please notify the sender immediately by return 
e-mail, and delete this message. 

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its 
employees shall not be liable for the incorrect or incomplete transmission of 
this e-mail or any attachments, nor responsible for any delay in receipt. 
Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch 
Airlines) is registered in Amstelveen, The Netherlands, with registered number 
33014286
********************************************************
                        

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [ADSM-L] Remove the Trailing .000000 in date_time, Loon, EJ van (ITOPT3) - KLM <=