473,394 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Convert character to date

how to convert character to date. writetime is character data type.
i want to have CPU utilization of last 24 hrs. for time being i want to have result from 1 server.


select "AVG_%_Total_Processor_Time", "WRITETIME", "MAX_%_Total_Processor_Time", "MIN_%_Total_Processor_Time", "AVG_%_Total_Privileged_Time" , "AVG_%_Total_User_Time", "AVG_Context_Switches/Sec", "AVG_Total_Interrupts/Sec"
from "NT_System_HV"

where "Server_Name" = 'Primary:ITM6VM:NT' and "WRITETIME" between '0000000000000000' and'9999999999999999'

query working fine till where server name but i am confuse how to utilize and get result from between clause and get last 24 hrs result.



i want this query for BIRT report design and itm6.2.
Jun 20 '08 #1
2 3981
docdiesel
297 Expert 100+
Hi,

if you can't change the WRITETIME column to integer, then try to add a generated column which automatically gets set as converted integer value of WRITETIME:

Expand|Select|Wrap|Line Numbers
  1. alter table NT_System_HV
  2.   add column  WRITETIME_INT
  3.   GENERATED ALWAYS AS ( int(WRITETIME) )  ;
and modify your SELECT statement:

Expand|Select|Wrap|Line Numbers
  1. ... and "WRITETIME_INT"
  2.   between 0 and 9999999999999999
Regards,

Bernd
Jun 24 '08 #2
select date(19-1-08) from sysibm.sysdummy1
Jul 7 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Loi Tan Vo | last post by:
Hi, I have a text file that contains a date column. The text file will be imported to database in SQL 2000 server. After to be imported, I want to convert the date column to date type. For...
11
by: jguilford | last post by:
I have created a SQL Stored Procedure that uses a Case statement to determine the Order By. For one of the Case statements I am trying to turn a Char field into Datetime in for the Order By,...
2
by: ggnanaraj | last post by:
In AS/400, have a table that has a character field defined. This has to be converted to date format of YYYY-MM-DD. The sample character data is as follows: 02/05/2005. In UDB, you can do a...
7
by: Nimmy | last post by:
Hi, I have a file which has different dates, I want to scanf them as CHAR and convert them to DATE format, how can I do this? Thanks
14
by: Me | last post by:
Hi all I am getting a really bizzare error on when I convert a string into a datetime: The code is : DateTime dt1 = Convert.ToDateTime("10 Sep 2005"); Console.WriteLine(dt1.Year);
1
by: izziy | last post by:
Our legacy DB has a bad column which stores a date value as char(8), it has a format like 'MMDDYYYY'. I am creating a report to report this particular date and also use this date to specify a...
0
by: tbrmc | last post by:
Hi frnds, Could anybody tell me how to convert date in character type field into particular date format
1
by: rdraider | last post by:
I can't seem to find a way to convert an INT type in the form of YYYYMMDD to an actual date form of mm/dd/yyyy Can anyone pointt me in the right direction? Thanks
2
by: cpeters | last post by:
I have a file that I need to import into a DB2400 table. One of the columns is a character string that is really a date in yyyymmdd format (ex. 20080520). How can I convert this into a date? Is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.