Forms :: Adding Hours And Minutes To Time

Feb 11, 2011

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 .

View 1 Replies


ADVERTISEMENT

SQL & PL/SQL :: Adding Two Numbers To Get Hours:minutes Format?

Jul 9, 2010

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)
-----

View 6 Replies View Related

Covert A Time Shown As 001200 (12 Hours) To 720 Minutes

Feb 10, 2012

I am trying to covert a time shown as 001200 (12 hours) to 720 mins. I have tried the following but get errors when executing:

(MTTD)>=TO_DATE('000000','HH24:MI:SS').

I have also tried .

MTTD = to_date('000000','HH24:MI:SS') =trunc(sysdate,'MM')*24*60; and neither is working.

What am I doing incorrectly?

View 1 Replies View Related

SQL & PL/SQL :: Get Difference And Convert Integer To Time In Hours And Minutes

Jun 14, 2012

How to get Time Difference between two DateTime Columns in Oracle 10g ?

View 10 Replies View Related

PL/SQL :: Get Time In Hours Minutes And Seconds Subtract Between Two Varchars?

Oct 18, 2012

I have two varchar variable which has value like this

v_outpunch1:='17:50:00'
and v_Shifttime:='18:00:00'

this both time i am subtracting here and storing in another varchar variable which is like this.

v_EarlyLeaverstimeformat := LPAD((extract(hour from TO_TIMESTAMP (v_ShiftTime,'HH24:mi:ss')) - extract(hour from TO_TIMESTAMP (v_OutPunch1,'HH24:mi:ss'))), 2, '0')||':'|| LPAD((extract(minute from TO_TIMESTAMP (v_ShiftTime,'HH24:mi:ss')) - extract(minute from TO_TIMESTAMP (v_OutPunch1,'HH24:mi:ss'))), 2, '0')||':'|| LPAD((extract(second from TO_TIMESTAMP (v_ShiftTime,'HH24:mi:ss')) - extract(second from TO_TIMESTAMP (v_OutPunch1,'HH24:mi:ss'))), 2, '0');

it's not subtracting value correctly.

View 3 Replies View Related

SQL & PL/SQL :: How To Get Hours / Minutes And Second From Date Datatype Field

Jan 14, 2012

I have a field " Tran_date " with datatype Date . It contains date as well as time . How can I get the time . I tried with it as below :

SELECT TO_CHAR(TRAN_DATE,'DD-MON-YYYY HH24:MI:SS') FROM ABC
WHERE COMP=1 AND
BRANCH=1 AND
LOC_CODE='12' AND
TRAN_DATE='12-JAN-2012' ;

VALUE IS COMING LIKE THIS :
12-JAN-2012 00:00:00

ALTHOUGH THERE IS TIME . Its not zero .

View 3 Replies View Related

SQL & PL/SQL :: Finding Hours And Minutes Between Two Char Field?

Mar 24, 2012

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)

View 2 Replies View Related

SQL & PL/SQL :: Total Number Of Hours And Minutes Of Given Dates

Sep 28, 2011

SELECT emp.emp_id, emp.ename, TRUNC (attendancedatetime),
TRUNC ( ( 86400
* (MAX (attendancedatetime) - MIN (attendancedatetime))
)
/ 60
)
- 60

[Code]...

Following is the out put:

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.

View 2 Replies View Related

SQL & PL/SQL :: Subtract Two Numbers And Convert Result As Hours And Minutes

Oct 6, 2010

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.

View 7 Replies View Related

How To Round Time Up Or Down By 5 Minutes

Nov 29, 2006

is there a prebuilt function that will round say the time of a sysdate up or down 5 mins? so i entered 5:32pm i would want it to round it down to 5:30pm

View 1 Replies View Related

How To Display Time In Minutes

Oct 15, 2012

I have two columns which I need to add together then devide by 60 in order to display that time in minutes. the problem I am facing is that at times I get numbers above 60 and my client doesn't want to see numbers above 60.

i.e (col1 + col 2)/60 = 34.87

what I need to do is make sure that when the number reaches 60 it moves on to 35.

View 2 Replies View Related

PL/SQL :: Date Is Greater Than Current Time Plus 24 Hours?

May 26, 2013

how to pull data from a table where date is greater than current time (+24 hours)... my date field is in the following format 15-MAR-2013 20:07:00

I want to do something like this

select * from table_A where date_field > (sys_date_time) +24h

as an example, when I run a query @ 4 PM on March 26, I want to pull data that has date > 4 PM March 27

View 6 Replies View Related

Check Elapse Time For Particular Query Ran From Last 24 Hours

Dec 26, 2012

Need to check the elapse time for particular query ran from last 24 hours , it was ran multiple times and need to know for each execution what is elapse time .

which view we can use ?

View 5 Replies View Related

Adding Up Time Values In Varchar2?

Mar 6, 2009

column name: extra_hour

datatype: varchar2(5)

extra_hour
----------
01:30
01:30
00:00
02:45
and so on...

Problem: I want to add up all the given value and display it in a select statment, that is the output should be:

Output:

XXXXXX
----------
05:45

View 4 Replies View Related

SQL & PL/SQL :: Adding Time Zone Onto A Query

Nov 17, 2011

I was given this query: SELECT TZ_OFFSET('EST'),dbTIMEZONE,SESSIONTIMEZONE, CURRENT_TIMESTAMP FROM DUAL;

My coworker also said this:

Using this statement as a starting point:

SELECT TZ_OFFSET('EST'),dbTIMEZONE,SESSIONTIMEZONE, CURRENT_TIMESTAMP FROM DUAL;

but I need

for

select -5 from dual;

to return

America/NewYork or EST

View 6 Replies View Related

Adding Time Part To Current Date To Form Timestamp

May 17, 2011

I have a column where I have time stamp with date and time(8-May-10 10:20:55 Am) from that i will get only time(10:20:55 Am)[query for this mentioned below] Now i need to append the time to current date and insert into a Timestamps column only .

so my result should be 17-May-11 10:20:55 Am(Assuming current Date is 17-May-11) . I tried search it by i found a way in sql server by using DataAdd and DataDiff .

query to get the time is:select to_char(to_date('11-MAY-11 05.00.00 PM', 'DD-Mon-YY HH:MI:SSAM'),'HH24:MI:SS') "Time Now" from dual

View 1 Replies View Related

Forms :: Days Hours Min And Seconds Calculation

Nov 5, 2010

I am able to run this query in Sql Prompt.

DEFINE Today = TO_DATE('03.12.2004:10:34:24','DD.MM.YYYY:HH24:MI:SS')

SELECT TO_CHAR(hiredate,'DD.MM.YYYY:HH24:MI:SS') "Hiredate",
TO_CHAR(&Today,'DD.MM.YYYY:HH24:MI:SS') "Today",
trunc(86400*(&Today-hiredate))-60*(trunc((86400*(&&Today-hiredate))/60)) "Sec",

[Code]...

It gives proper / desired results. I want to use it on my Form, how can it be done?

View 3 Replies View Related

Forms :: Oracle Form Login - No Warning Message After 5 Minutes

Nov 11, 2009

Is there any way to make a form timeout.

After login into form if there is no transaction/event happens I want it to throw one warning message after say 5 minutes.

View 9 Replies View Related

Forms :: Adding A Save (Update) Button

Nov 28, 2012

I have one form where I have let's say 2 items that I want to manage. One is a List Item and the other Text Item. Both are based on one table. The List Item is not updatable (Update Allowed is set to NO) and there I have some types of houses for example (T -> tall house, B -> Big house, S -> Small house it's not important so much) and the Text Item is for counting the types for example we have 4 houses of type T and if we add another one in the textItem we will see 5, so it's not counter for all houses but it counts types of houses and that item is not updatable nor insertable (Update allowed and Insert allowed are set to NO) so it's only purpose is just to show how many hauses we have of particular type and automatically increases the number if we insert new house. Beside this two items I have another Items that conatin some informations about the house (How many flats, doors, windows, and so on..). you've got the picture of my form and table.

Now I want to add one button with trigger WHEN-BUTTON-PRESSED that will do this. If I want to change the type of the house after I inserted it and save it in the table, I have to just change the type in the List Item (choose another type) and press the button to save the same house with the same properties I would say (How many flats, doors, windows, and so on..) but with another type. First when I press the button it must ask me if I am sure that I want to make that change (I'll make an allert fot that) and if I press OK or Yes my house will be saved just with the different type and the previous house with the previous type must be erased. And in the textItem 'the counter', the number of the new type must encrease for one and the previous type must decrease for one.

I hope you understand what I want to do and all I need is that trigger to manage this problem of mine. I know it's possible to do but I am quite new in DB programming and I am not very good with programming in PL/SQL.

View 6 Replies View Related

Forms :: Adding Selected List Box Value Into Text Box

Oct 29, 2013

I am creating one application in oracle forms in which one push button is dere for dept_list and textbox for displaying dept_name, after clicking button it shows list of dept_id and dept_name in listbox. and after selecting any one value from it adding into textbox of dept_name and update it. How to do this in oracle forms 6i?

View 2 Replies View Related

Forms :: Adding 5 Mins To A Form Field In Library

Jun 24, 2013

I have a date field in my form (date.start_time) in which I want to reference in a library and add 5 mins to the time (since its in the lib I am coding this I need to use name_in ). My current code is:

copy(name_in('date.start_datetime')+5/24/60 , 'DATE.END_DATETIME')

However, this seems to be erroring.

View 2 Replies View Related

Forms :: Adding Image Manipulating Java Class?

Jul 13, 2012

Our system stores images on the unix filesystem. We scan full page images.

Our image specs are:

black and white: tiff, group4 compression, 300dpi. so files are about 40-80k compressed

photograpshs/gray scale: jpeg/jpeg compression 256 gray scale. Some images can be 2megs...but most of them are about 400-700k

We build a demo with forms10G/application server 1 year ago and performance was really bad. Took about 10-15 seconds to generate a report with 1 image of it...compared to about 1-2 secs using forms 6i. We just installed weblogic 11G (10.3.5) with forms 11gr2. I'm guessing performance will still be an issue but we will still be testing it.

Our users currently use nfs to access images on the unix server. So that would not changed.

- read_image from filesystem (c: unc path //server/images/.../1.jpeg)

- zoom in, zoom out (having vertical/hori scroll bars to move around...or best would be panning)

- save_image on filesystem

- fit to window/cancas

- always keeping aspect ratio

nice to have options, but not needed at this time

- save in blobs

- editing capabilities (mostly just select an area to delete, like black borders...some speckles here and there)

View 1 Replies View Related

SQL & PL/SQL :: How To Compare Hours

Jan 10, 2011

I want to write a function that gets:

1. event_date (dd/mm/yyyy)
2. event_start_time (??/??/???? HH24:MI)
3. event_end_time (??/??/???? HH24:MI)

I got a table called EVENTS that got 2 fields:

1. event_date (dd/mm/yyyy HH24:MI)
2. event_end_date (??/??/???? HH24:MI)

and want to check if there is an event in my EVENTS table that occurs in the same dd/mm/yyyy as the input, and can disturb the input event times. means:

input.event_start_time is between EVENTS.event_date
and EVENTS.event_end_date
and
input.event_end_time is between EVENTS.event_date
and EVENTS.event_end_date

but to compare only the hours here! (HH24:MI)
because the date (dd/mm/yyyy) is checked before..

I don't know how to cut only the hours out of the date and compare them, and don't know how to write the whole function.

View 2 Replies View Related

SQL & PL/SQL :: How To Get Minutes Between Two Times

Oct 19, 2012

i want one query which return minute between two times which is in this format: 12:00:00 and 06:00:00

so in this it should return 360 minutes.

View 5 Replies View Related

SQL & PL/SQL :: Displaying 24 Hours Data

Dec 27, 2010

I have a table which will the following type of data

"COL1""COL2"
1001"27-DEC-2010 02:00:00"
1002"27-DEC-2010 07:00:00"
1003"27-DEC-2010 09:00:00"
1004"27-DEC-2010 02:00:00"
1005"27-DEC-2010 12:00:00"

Here you can see that we have data for 27th Dec 2010 02,07,09 and 12 hours. I want a query which will show the full 24 hours data even if it doenst have any records. like the following,

COL1 COL2
0 2010122701
1001 2010122702
1004 2010122702
0 2010122703
0 2010122704
0 2010122705
0 2010122706
1002 2010122707

View 2 Replies View Related

SQL & PL/SQL :: Calculating The Business Hours

Aug 15, 2011

I have a field in Customers table called shipeddate....

I wnat to check the number of hours an item which has a shipeddate is in the store room to the current datetime...

But the business hrs of the store room are from 8am-5pm..

So when a shipped date is 4pm on MOnday

and i am checking on 9 am Tuesday the number of hrs shud be 1(4-5 of Monday)+1(8-9 of tuesday) =2hrss..

How can i achieve this...

View 2 Replies View Related

SQL & PL/SQL :: How To Get Correct Minute Between Two Hours

Oct 22, 2012

i am using one query but not getting correct minutes.

here is my query:

v_Interval:= to_timestamp(v_temphrs,'HH24:MI:SS')-to_timestamp(v_outpunch1,'HH24:MI:SS');
v_TotalHrsMin1 := extract(hour from v_interval) * 60 + extract(minute from v_interval);

here v_interval datatype is "interval day to second" and v_temphrs datatype is varchar2 and value is : 12:00:00 and v_outpunch1 datatype is varchar2 and value is: 06:10:00
and v_totalHrsMin1 datatype is number.

here i should get value 370.
but i am getting value 350.

View 3 Replies View Related

SQL & PL/SQL :: Calculating Working Hours?

May 8, 2010

I am using the below sql query to calculate working hours. The problem which i am facing is that query is taking lot of time to calculate the working hours. reduce the execution time of this query or if there is any other way to calculate working hours

The following query take 63.499 sec

SELECT sql_calc_found_rows gstime,
MAX(stoptime) AS mx,
MIN(starttime) AS mn,

[Code].....

View 6 Replies View Related

PL/SQL :: Convert Number To Hours

Jan 1, 2013

I want to convert below MS-SQL query in oracle 10g.

for eg:

Select numasdate,
Cast(numasdate / 60 as Varchar) + ' hours ' +
Cast(numasdate % 60 as Varchar) + ' minutes'
as [TotalHoursAndMinutes]
From
#SampleTable

Output:

9436 157 hours 16 minutes
537 8 hours 57 minutes
9323 155 hours 23 minutes
12525 208 hours 45 minutes

View 8 Replies View Related

PL/SQL :: Generate Hours Range

Oct 4, 2012

I have a table with a date field. This field storage dates with hours like this:

01-08-2012 8:30:00
01-08-2012 8:15:00
01-08-2012 9:30:00
01-08-2012 9:40:00
02-08-2012 8:30:00
02-08-2012 9:30:00
02-08-2012 9:34:00
...

I have to generate a report with the day and the frequency :

__Day_______ Hour Range__CountRecords
WEDNESDAY 8 - 9 2
WEDNESDAY 9 - 10 2
THURSDAY 8 - 9 3

The block of the hour must be 1 hour (8-9,9-10 and so on)

how generate the hours range.

My database oracle version is 8i. (I know that is very old but I can't change because It´s a legacy system).

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved