I want to find the hours and minutes between two char field data type.Example I have two char columns one is "start_time" and another one is "end_time".The start time and end time is the machine reading of CNC MACHINE in manufacturing.I want to develope the package to capture the actual machine running time.But I have the start and end time reading in character field.The machine reading format is hour:minutes:seconds only.It will looks like 1234:45:23(the machine ran 1234 hours and 45 minutes and 23 seconds).See the below table to understand my requirements.
start_time end_time result in hours & minutes ---------- -------- ------------------------- 345 347 2 hrs 347 350 3 hrs 350 357.20 7 hrs and 20 minutes
If I subtract end_time - start_time I will get the result in char type only not in hours and minutes format.Another example
start_time end_time result in hours & minutes ---------- -------- ------------------------- 357.21 360.40 3.19(If subtract end_time - start_time)
I currently have a problem where I have two date fields with time stamps. The only bit i am currently interested in in these fields is the time factor. When i display them in their field they have a format of HH24:MI .
I have a start time and end time as well as a duration and duration type. What I am trying to do is the following: when the user inputs the start time, along with the duration say 1 for example and the duration type of say HRS for example I would like to have the end_datetime default to 1 HR from the current start time. This is the code I use on a when validate item trigger to acheive this:
case :blk.duration_type when 'HRS' then :blk.end_datetime := :blk.start_datetime + ((1/24)* :blk.duration); when 'MINS' then :blk.end_datetime := :blk.start_datetime + ((1/24/60)* :blk.duration);
However, every time it triggers the value put into end_datetime is 0:00 is it something to do with the datatypes im using .
I have a query to add two numbers and get results in hours:minutes format.Example I want to add 12.20 and 6.15 and get result in hours and minutes like 18.35 (hours & minutes).if minutes that is after precision exceed more than 60 it should treat as 1 hour.like i want to add
12.35 (number 1) before precision its hour and after its minutes 06.25 (number 2) 04.25 (number 3) ----- 23.25 (23 hours and 25 minutes) -----
EMP_IDENAME Date Min Hrs 10013Javed Iqbal09/20/2011 00:00:0036.007.00 10013Javed Iqbal09/21/2011 00:00:0027.007.00 10013Javed Iqbal09/22/2011 00:00:0049.007.00 10013Javed Iqbal09/23/2011 00:00:000.000.00 10013Javed Iqbal09/24/2011 00:00:000.000.00
i need the TOtal sum of Minutes and Hrs e.g 7+7+7=21 and also minutes but if minutes total increase from 60 minutes then it should add to hrs .how to get sum.
I want to convert numbers into hours and minutes.I have two numbers say like first number is 1234 and second number is 1235.4 now i want to find the different between these two numbers. so am subtracting number 2 - number 1
1235.4 - 1234 i will get 1.4 so the result of this 1.4 to be converted as hours and minutes like 1 hr and 40 minutes. How can i convert numbers in hrs and minutes.
How to get max and min value from a varchar2 datatype column?
CREATE TABLE TEST ( WEIGHT VARCHAR2(20) ); INSERT INTO TEST VALUES('100'); INSERT INTO TEST VALUES('120'); INSERT INTO TEST VALUES('113'); INSERT INTO TEST VALUES('145'); INSERT INTO TEST VALUES('204'); INSERT INTO TEST VALUES('130');
I've to find the max and min weight from this data.
I can't seem to understand why the hour is incorrect. Below query "dte_computation_on_data" is the old function they use to convert date and insert it to the table. Problem is when I revert it to the actual date the hour is incorrect.
CODE SELECT -- THIS HERE IS MY TEST TO REVERT TIME AND DATE ON THE FORMULA OF WITH RESPECT TO THEIR FUNCTION to_char(TO_DATE('19700101', 'YYYYMMDD')+(tb1.dte_computation_on_data/86400),'MM/DD/YYYY') || ' ' || to_char(to_date(mod (tb1.dte_computation_on_data,86400) ,'sssss'),'hh24:mi:ss ') revert_test, systimestamp,tb1.dte_computation_on_data from ( SELECT -- THIS IS THE FORMULA OF THE OLD FUNCTION THEY USE TO CONVERT DATE TO NUMBER AND INSERTED ON THE ROW floor((CAST(SYS_EXTRACT_UTC(systimestamp) AS DATE) - TO_DATE('19700101', 'YYYYMMDD')) * 86400) dte_computation_on_data FROM dual)tb1;
What i wnat is to update the Customer_inactive_date with the Incative_date field from Customer_type based on their Customer_type... So james and Jill would have their rows updated in this scneario ..How can i achive this in pl/Sql
I have teh code using merge function..I want something in traditional old fashion..
Version : 4.1.1, I have a tabular form on a DB table. One of the columns is a date field. When the user hits the "add Row" button on the tabular form, I want the Date field to be defaulted to sysdate. Here is what I have tried so far,
1. Created a "hidden" item P1_SYSDATE and populated the default value with sysdate. After this, under the DB tabular report date field, I used default type - Item/application on this page and entered P1_sYSDATE
2. Instead of populating the default value of the P1_SYSDATE hidden item, I created a before regions process and added
:P1_SYSDATE := sysdate
and added P1_SYSDATE to default type of the tabular date field with default type as "ITem/application on this page.
I get the error
ORA-01790: expression must have same datatype as corresponding expression
I tried to_Char(sysdate,'dd-mon-yyyy') and then converting it back to to_date. still no luck.
A field named xxx_date is a text item which we have to enter manually so as to update a record in that particular date. This is a mandatory field without which we cannot continue the data entry..
I am getting this error while trying to update the record
FRM-40509 :Oracle error :unable to update record
I have kept the enabled = yes required=no data type=Date.. in the property pallet
I have a date field that should be filled everyday with today's date and I need to get the days that were not entered.
i.e. :
CREATE TABLE TRY_F (DAT DATE);
INSERT ALL INTO TRY_F VALUES (to_date('01/01/2011','DD/MM/YYYY')) INTO TRY_F VALUES (to_date('02/01/2011','DD/MM/YYYY')) INTO TRY_F VALUES (to_date('04/01/2011','DD/MM/YYYY')) INTO TRY_F VALUES (to_date('05/01/2011','DD/MM/YYYY')) INTO TRY_F VALUES (to_date('06/01/2011','DD/MM/YYYY')) INTO TRY_F VALUES (to_date('08/01/2011','DD/MM/YYYY')) INTO TRY_F VALUES (to_date('10/01/2011','DD/MM/YYYY')) INTO TRY_F VALUES (to_date('14/01/2011','DD/MM/YYYY')) SELECT * FROM DUAL;
I need a smart way of getting the dates that were missed in DAT.
I am having problems with the XMLTable function. I cant get it to see the entire date/time value in a date field. This wont work
select x1.* from XMLTABLE('/DOCUMENT' passing xmltype('<DOCUMENT><STR>abc def ghi</STR><NUM>1234</NUM><DT>2013-02-17T04:24:02</DT></DOCUMENT>') columns STR varchar2(25), NUM number, DT date) x1;
However if I change the DT tag to just the date only "2013-02-17" it works. Why wont Oracle see the entire date/time format even if its ISO 8601 compliant?
I would need to convert the column datatype from BLOB to CLOB. currently in the table, the BLOB column has the data. the requirement is to convert this column from BLOB to CLOB datatype.
How to convert from BLOB datatype to CLOB datatype ?
I want to force a datetime field to display as date only. How can I do this? This is so when prompting for a value for this field a user doesn't have to also enter the time. At the moment the prompt returns nothing when entering only a date as it does not match any value as they all have times also.
Begin insert into employee_rev values(111, 'DEC-09', '31-DEC-2009', '01-APR-2009', 1300); insert into employee_rev values(111, 'JAN-10', '31-JAN-2010', '01-APR-2009', 1000); insert into employee_rev values(111, 'FEB-10', '28-FEB-2010', '01-APR-2009', 800); insert into employee_rev values(111, 'MAR-10', '31-MAR-2010', '01-APR-2009', 1000); insert into employee_rev values(111, 'APR-10', '30-APR-2010', '01-APR-2010', 1000); insert into employee_rev values(111, 'MAY-10', '31-MAY-2010', '01-APR-2010', 1100); insert into employee_rev values(111, 'JUN-10', '30-JUN-2010', '01-APR-2010', 2100); End;
I also need a YTD (Year to Date) field at the last which is sum of current month revenue_amt and sum(revenue_amt) for previous months for a particular financial_year_date.
The output should be:
Person_ID Month End Date Year Date Rev YTD 111 Dec-09 31-Dec-09 1-Apr-09 1300 1300 111 Jan-10 31-Jan-10 1-Apr-09 1000 2300 111 Feb-10 28-Feb-10 1-Apr-09 800 3100 111 Mar-10 31-Mar-10 1-Apr-09 1000 4100 111 Apr-10 30-Apr-10 1-Apr-10 1000 1000--change in financial year 111 May-10 31-May-10 1-Apr-10 1100 2100 111 Jun-10 30-Jun-10 1-Apr-10 2100 4200
I guess this should be achievable using some analytical functions, but I am unable to get the desired output.
I have a field (called Date_Time) which displays for example 1/31/2005 12:00:00 AM. I would like to run a query that converts that value to '200501' in a created field.
I tried the following below but I keep having problems.
select Account_Number, Date_Time, concat(year(Date_Time), month(Date_Time)) as Date_Time_Modified from table where Account_Number = xxxx
if i make the source for a field is a current date with format dd/mm/rrrr hh:mi:ss and the report published on the application server and the clients from different machines run this report
what the field display on Cline or on DB or On Application Server?