calculate the duration
data
From time to time
November 10, 2015 16:00 November 10, 2015 17:10
November 10, 2015 16:50 10 November 2015 18:00
November 10, 2015 17:15 November 10, 2015 23:00
November 10, 2015 17:30 November 10, 2015 22:20
November 10, 2015 19:35 November 10, 2015 19:50
from the first record, if I want to calculate the time duration that is, 70 min.
second disc begins to the first record. service time is now 18-16 120 min.
third record also begins in the second. duration is now 300 min 23-16.
fourth and fifth registration is the responsibility of the third record time.
so final duration is 18-16 = 120 min.
How can I achieve this. Please just write the sql query.
Thank you.
teefu.
Lahore. in Pakistan.
SQL> SQL> -- SQL> select * from dt_lines order by f_dntime, t_dntime; DT_ID F_DNTIME T_DNTIME DT_DUR ---------- -------------------- -------------------- ---------- 1 10-Nov-2015 16:00:00 10-Nov-2015 17:10:00 70 2 10-Nov-2015 16:50:00 10-Nov-2015 18:00:00 130 3 10-Nov-2015 17:15:00 10-Nov-2015 23:00:00 345 4 10-Nov-2015 17:30:00 10-Nov-2015 22:20:00 290 5 10-Nov-2015 19:35:00 10-Nov-2015 19:50:00 15 6 10-Nov-2015 23:15:00 10-Nov-2015 23:45:00 30 6 rows selected. SQL> SQL> -- SQL> with t as ( 2 select f_dntime, t_dntime, 3 case when min(f_dntime) over (order by f_dntime, t_dntime rows between unbounded preceding and 1 preceding) is null 4 then f_dntime 5 when f_dntime > max(t_dntime) over (order by f_dntime, t_dntime rows between unbounded preceding and 1 preceding) 6 then f_dntime 7 end as max_fdt_adjusted 8 from dt_lines 9 ), 10 t1 as ( 11 select f_dntime, t_dntime, max_fdt_adjusted, 12 last_value(max_fdt_adjusted ignore nulls) over (order by f_dntime) as min_from_ts 13 from t 14 ) 15 select min_from_ts, max(t_dntime) as max_to_ts, 16 round((max(t_dntime) - min_from_ts)*24*60) as duration_min 17 from t1 18 group by min_from_ts 19 order by min_from_ts 20 ; MIN_FROM_TS MAX_TO_TS DURATION_MIN -------------------- -------------------- ------------ 10-Nov-2015 16:00:00 10-Nov-2015 23:00:00 420 10-Nov-2015 23:15:00 10-Nov-2015 23:45:00 30 2 rows selected. SQL> SQL>
Tags: Database
Similar Questions
-
Help: How do I calculate the duration between 2 dates, when these dates on 2 rows?
Hello
We are 11g.
We have a table with times recorded in a column. Then, each line as a different date value.
There is no pb to order the query on this date column (obviously)
Now, we need to calculate the period of time between 2 successive rows.
I first thought to use a cursor, the cursor loop, compute and update the "duration" column
It's the basic option
Now, I would like to know if, by using a single query, I couldn't directly the calculation I want?
Here is my example:
Ideally, that's what I would get (if my math is correct)WITH t AS ( SELECT 'aaa' col1, to_date( '20100201 09:23:50', 'YYYYMMDD HH24:MI:SS') date1 FROM dual UNION SELECT 'aaa' col1, to_date( '20100201 13:14:33', 'YYYYMMDD HH24:MI:SS') date1 FROM dual UNION SELECT 'aaa' col1, to_date( '20100207 13:14:33', 'YYYYMMDD HH24:MI:SS') date1 FROM dual UNION SELECT 'bbb' col1, to_date( '20100202 09:21:10', 'YYYYMMDD HH24:MI:SS') date1 FROM dual UNION SELECT 'bbb' col1, to_date( '20100203 08:11:06', 'YYYYMMDD HH24:MI:SS') date1 FROM dual UNION SELECT 'bbb' col1, to_date( '20100203 15:13:55', 'YYYYMMDD HH24:MI:SS') date1 FROM dual UNION SELECT 'bbb' col1, to_date( '20100210 10:14:27', 'YYYYMMDD HH24:MI:SS') date1 FROM dual ) SELECT col1, to_char( date1,'YYYYMMDD HH24:MI:SS') date1 FROM t ORDER BY col1, date1;
I hope I'm clear!COL DATE1 DURATION --- ----------------- ---------- aaa 20100201 09:23:50 0 aaa 20100201 13:14:33 13843 aaa 20100207 13:14:33 518400 bbb 20100202 09:21:10 0 bbb 20100203 10:11:06 89396 bbb 20100203 15:13:55 18169 bbb 20100210 17:14:27 612032
Thanks a lot in advance for your help
OlivierOf course; It's easy with the use of the function analytic lag:
WITH t AS (SELECT 'aaa' col1, to_date( '20100201 09:23:50', 'YYYYMMDD HH24:MI:SS') date1 FROM dual UNION ALL SELECT 'aaa' col1, to_date( '20100201 13:14:33', 'YYYYMMDD HH24:MI:SS') date1 FROM dual UNION ALL SELECT 'aaa' col1, to_date( '20100207 13:14:33', 'YYYYMMDD HH24:MI:SS') date1 FROM dual UNION ALL SELECT 'bbb' col1, to_date( '20100202 09:21:10', 'YYYYMMDD HH24:MI:SS') date1 FROM dual UNION ALL SELECT 'bbb' col1, to_date( '20100203 08:11:06', 'YYYYMMDD HH24:MI:SS') date1 FROM dual UNION ALL SELECT 'bbb' col1, to_date( '20100203 15:13:55', 'YYYYMMDD HH24:MI:SS') date1 FROM dual UNION ALL SELECT 'bbb' col1, to_date( '20100210 10:14:27', 'YYYYMMDD HH24:MI:SS') date1 FROM dual), t_diff as (SELECT col1, to_char( date1,'YYYYMMDD HH24:MI:SS') date1, (date1 - lag(date1, 1, date1) over (partition by col1 order by date1))*24*60*60 date_diff FROM t) select col1, date1, sum(date_diff) over (partition by col1 order by date1) duration from t_diff ORDER BY col1, date1;
Published by: Boneist on February 15, 2010 16:39
(I can't read; initially gave the cumulative total of the period. Oh!)ETA2: Take note of the additional parameters, I used in the lag() - the third parameterd manages what should be the value in the field if there is no previous rank, so there is no need to use nvl elsewhere in the application to handle this situation.
Published by: Boneist on February 15, 2010 16:42
-
My Apple Watch is not accurately calculate the duration of my exercise
Yesterday morning, I worked with a personal trainer for an hour. We checked my heart rate using my Apple Watch periodically throughout the workout, and, on average, she recorded about 160 BPM. It was a hard workout, and I was absolutely exhausted at the end of the hour. However, when I checked the activity Tracker on my Apple Watch, he said I had only worked for 22 minutes. I calibrated my Apple Watch. Why my intense workout of an hour is not save to my Apple Watch?
Hello
Progress towards your goal of exercise of credit, the application of the activity is to identify the activity equal or exceed the intensity of a brisk walk. The definition of this varies based on the personal information. To check that your personal information is accurate:
-On your iPhone, in the application of Eve, go to: My Watch tab > health > change.
For the purposes of rehabilitation appropriations in General everyday wear, enforcement activity relies on movement of arm (measured by accelerometer). For best results, let the arm on which you wear your watch to swing naturally as you exercise. If you have not saved your activity as a workout, it was the only information that has been taken into account in the allocation of the appropriations for the year.
In addition to using the accelerometer data, the training app allows also the heart rate sensor data and - for outdoor activities - GPS data (when they are available via the iPhone paired).
The heart rate sensor is likely to give better results for the workouts that involve rhythmic (for example running) rather than the irregular movements (weight, for example). For best results, your watch should sit comfortably against the top of the wrist. For best performance, Apple suggests you consider your clamping watch band before workouts and it loosen again thereafter. For the exercises or other activities that involve bending your wrist, it can also help to move your watch further to the top of your arm.
If you want to save the entire workouts as exercise regardless of their levels of intensity, follow them through the application of training using others as the type of activity. This credit a minute of exercise for each minute of the workout.
More information:
-
calculate the time difference between several lines
Hello
I have a table as below:
create table select TEST_CASETBL (ID, CASE_NUM, CASE_STATUS, CASE_SUB_STATUS, LAST_UPD_DTTM)
112, 123-456', 'open', 'Work', TO_DATE (11 March 2015 13:00 ',' dd/mm/yyyy hh24:mi:ss') of the DUAL union all select
113, 123-456', 'Open', 'pending on the admin', TO_DATE (10 January 2015 15:00 ',' dd/mm/yyyy hh24:mi:ss') of the DUAL union all select
114, 123-456', 'Open', 'client expectation', TO_DATE (10 July 2015 09:00 ',' hh24:mi:ss' of dd/mm/yyyy) of the DUAL union all select them
315, 123-456', 'open', 'Work', TO_DATE (September 15, 2015 10:00 ',' dd/mm/yyyy hh24:mi:ss') of the DUAL union all select
219, 123-456', 'Open', 'pending on the admin', TO_DATE (January 9, 2015 08:00 ',' dd/mm/yyyy hh24:mi:ss') of the DUAL union all select
651, 123-456', 'open', 'Work', TO_DATE (August 20, 2015 10:00 ',' dd/mm/yyyy hh24:mi:ss') from DUAL;
I would like to calculate the duration total (days ideally) to CASE_SUB_STATUS, so have a set of lines:
CASE_NUM of work waiting on admin waiting on customer
-------------------------------------------------------------------------------------------------------------------------------------------------------
123-456 70days 6 hours
Here is the explanation of the pattern:
ex: for everyday business computing (timestamp timestamp of ID:651 - ID:219) +(timestamp of ID:315-timestamp of ID:114) + (ID:112 stamp - current_time) = 11 days + 21 days 22hrs 23hrs 36 days 9 hours
still waiting on admin
(ID:219 timestamp - timestamp of ID:315) + (ID:113 timestamp - timestamp of ID:112)
still waiting on the client
(ID:114 timestamp - timestamp of ID:113)
I would appreciate any idea how to solve this, ideally as an SQL
Thank you
Should he not?...
with test_casetbl (id, case_num, case_status, case_sub_status, last_upd_dttm) as)
Select 112, 123-456', 'Open', 'Work', TO_DATE (11 March 2015 13:00 ',' dd/mm/yyyy hh24:mi:ss') of all the DOUBLE union
Select 113, 123-456', 'Open', 'pending on the admin', TO_DATE (10 January 2015 15:00 ',' dd/mm/yyyy hh24:mi:ss') of all the DOUBLE union
Select 114, 123-456', 'Open', 'client expectation', TO_DATE (10 July 2015 09:00 ',' dd/mm/yyyy hh24:mi:ss') of all the DOUBLE union
Select 315, 123-456', 'Open', 'Work', TO_DATE (September 15, 2015 10:00 ',' dd/mm/yyyy hh24:mi:ss') of all the DOUBLE union
Select 219, 123-456', 'Open', 'pending on the admin', TO_DATE (January 9, 2015 08:00 ',' dd/mm/yyyy hh24:mi:ss') of all the DOUBLE union
Select 651, 123-456', 'Open', 'Work', TO_DATE (August 20, 2015 10:00 ',' the hh24: mi: ss' dd/mm/yyyy) double
),
t like)
Select case_num,
case_sub_status,
(last_upd_dttm, 1, sysdate) ahead of diff last_upd_dttm (partition by order of last_upd_dttm case_num).
of test_casetbl
)
Select case_num,
trunc (a) | "day (s). TO_CHAR (date ' 1-1-1' + a, "fmhh24" 'mi' minute (s) "ss" second (s) hour (s)"") "work."
trunc (b) | "day (s). TO_CHAR (day 1-1-1' + b, "fmhh24" 'mi' minute (s) "ss" second (s) hour (s)"") 'Waiting on admin',
trunc (c) | "day (s). TO_CHAR (day 1-1-1' + c, "fmhh24" 'mi' minute (s) "ss" second (s) hour (s)"") "waiting on customer."
t
pivot)
Sum (diff)
for case_sub_status in)
'Work' is.
B "waiting on admin',
C "customer expectation."
)
)
CASE_NUM Working Waiting on admin Waiting on customer 123-456 63 day (s) 22 hour (s) (s) 50 minute 49 second (s) 19 day (s) on 20 (s) hour 0 minute 0 second (s) 27 day (s) on 4 hour (s) 0 minute 0 second (s) -
Use the project start Date and duration to calculate the end Date of project
I'm trying to calculate the end date of the project in a report using the project end Date and time entered on the opportunity.
For example, if the start date of the project filled an opportunity is 31/01/2009 and the length (integer) is entered on the opportunity is 5, the project end date is in the report must be 30/06/2009.
I'm trying to TIMESTAMPADD forumaul allows you to add the duration (number of months) to the project start date
This Fx works TIMESTAMPADD (SQL_TSI_MONTH, 12, '-used Custom Attributes ".) DATE_40)
But if I try to replace the number twelve by the length (integer field) I get an error when you try to save: TIMESTAMPADD (SQL_TSI_MONTH, "-opportunity Custom Metrics".) S_INT_0, '-used custom attributes. DATE_40)
Any ideas on how I can get this to work would be greatly appreciated.Hi, try this. It might solve your prioblem TIMESTAMPADD (SQL_TSI_MONTH, CAST (YOUR FIELD AS INTEGER), account. (' "Last modified")
-John CRMIT
-
Calculate the sum of the duration stored in format HH24
Dear professionals,
I use Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production. I stored length of certain events in the table TIME_DURATION as as follows (format h24:mi):
CREATE TABLE "TIME_DURATION" ("ID" NUMBER(11,0), "HOURSMINUTES" VARCHAR2(5)); Insert into TIME_DURATION (ID,HOURSMINUTES) values ('5','00:55'); Insert into TIME_DURATION (ID,HOURSMINUTES) values ('7','00:18'); Insert into TIME_DURATION (ID,HOURSMINUTES) values ('9','06:34'); Insert into TIME_DURATION (ID,HOURSMINUTES) values ('15','00:12'); Insert into TIME_DURATION (ID,HOURSMINUTES) values ('17','09:50'); INSERT INTO TIME_DURATION (ID,HOURSMINUTES) VALUES ('41','12:39');
select * from time_duration; ID HOURS ---------- ----- 5 00:55 7 00:18 9 06:34 15 00:12 17 09:50 41 12:39 6 rows selected.
Now, I want to calculate the total time for all events (sum of all specific times). In this case, it should be 30 hours and 38 minutes.
Any help would be much appreciated.
Thanks in advance.
Hello
So, you want to add a number of lines varibale. This sounds like a job for the SUM function. AMOUNT of work on numbers, no channels such as time, so use TO_NUMBER to convert strings to numbers, so you can add them. If you want to display the result as a string, you can use TO_CHAR to convert the sum into a string.
WITH got_total_minutes AS
(
SELECT SUM ((TO_NUMBER (SUBSTR (heure, 1, 2) * 60)))
+ TO_NUMBER (SUBSTR (hour 4))
) AS total_minutes
OF time_duration
)
SELECT TRUNC (total_minutes / 60). ':'
|| To_char (MOD (total_minutes, 60))
, "FM00.
) AS total_hours_minutes
OF got_total_minutes
;
The output is not quite what you asked:
TOTAL_HOURS_MINUTES
--------------------
30: 28
If you really want 30:38', explain how to get it.
This solution assumes that time always is always 5 characters (2 digits, a separator and another of 2 digits) as it is in your sample data.
If your actual data aren't like your sample data, the same approach still works, but the SUBSTR expressions will be more complicated.
adnanBIH wrote:
Dear professionals,
I use Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production. I stored length of certain events in the table TIME_DURATION as as follows (format h24:mi):
- CREATE TABLE 'TIME_DURATION' ('ID' NUMBER (11.0), VARCHAR2 (5)) 'HOUR '.
- Insert into TIME_DURATION (ID, TIME) values ('5',' 00:55 ');
- Insert into TIME_DURATION (ID, TIME) values ('7',' 00:18 ');
- ...
Thanks for posting the CREATE TABLE and INSERT.
ID is a NUMBER, so do not use quotes around it:
Insert into TIME_DURATION (ID, TIME) values (5, ' 00:55 ');
Insert into TIME_DURATION (ID, TIME) values (7, ' 00:18 ');
...
Depending on how you plan to use the hour, you may want to store a NUMBER, also, or maybe an INTERVAL DAY TO SECOND.
-
How to calculate the difference between two times by the NUMBERS
I'm so bothered by the fact that I can't understand that.
Cell B2 - 08:00
Cell C2 - 10:50
(How can cell D2 - I get this cell to calculate the difference and say 02:50?)
I know it's probably one of the most basic operations, but for the life of me I can't understand it. The cells B2 and C2 are formatted for a 24-hour clock. But if I tell the system to just subtract the two, I get "0,118. Everything I find on the forum search goes beyond what I need. Can someone help me?
Thank you
Hi sapirs,
Departure and arrival of the cells are in Date and time with Date format: no and time: 24-hour clock.
Formula in D2 (fill down)
= C2−B2
The results become a duration format, but under automatic (numbers automatically worth this format)
If you wish, you can change the cells of lasting results.
What Data Format have your result cells?
Kind regards
Ian.
-
I would like the encoder of data as well as the duration of treatment in a table
Hello
I want to draw my value encoder of data as well as the duration of treatment simultaneously in a table by getting data in real time. Please help me with solutions or ideas.
Hi Jean Claude,
did you think of the VI you want to create - before actually creating it?
-Both your DAQAssistents started '1 value on demand' but you convert the thread of DDT in 2D arrays! Why? Why don't you convert a scalar - because that's what carries the thread of DDT!
-Why did you "insert a table", when you want to add to (or enhance) a table? Use rather BuildArray!
Having time values too you need to calculate: subtracting the start time of hour:
-
How to calculate the periods that overlap between two or more given the date range?
Hi all
If there are several durations then how we can calculate the period of time that overlap between these times.
For example: for 3 time periods. 03/12/2015-16/08/2015, 05/01/2015 to 31/07/2015 and the 06/09/2015 to 30/11/2015, how the overlap period can be calculated?
There are many potential unknowns in your question. For example, you want to count any overlap at all? If two dates overlap, what matters? Overlap - each of them?
In any case, here is a solution that counts how many periods are overlapping in any point in time... She, of course, using temporal logic. You can then use ValueAt(), WhenLast(), WhenNext(), etc. as appropriate.
Assume that your model has a child entity called 'the period' with name 'all time periods' relationship and basic attributes 'start date of the period of time' and 'date of end of period of time'.
In your example:
an entity should have the time period start date = 03/12/2015 and the date of end of period of time = 16/08/2015
another entity might have the time period start date = 01/05/2015 and the date of end of period of time = 31/07/2015
another entity might have the time period start date = 06/09/2015 and the date of end of period of time = 30/11/2015
To find the number of overlapping over time, we want to count or entities that have an active period, so the rule is perhaps the sum:
the number of overlapping = the number of all the periods for which it is true that the time period is active
How do we know a time is active? This is the time logic comes in. He is active on or after the start date or no later than the end date:
the time period is active if
TemporalOnOrAfter (the date of beginning of period of time) and
TemporalOnOrBefore (date of end of period of time)
That's all. Now, you can perform a temporal visualization of the 'number of overlapping' and you'll see it rise and fall over time. As a reference, he said that the number of overlapping = 3.0 from 06/09/2015 across 31/07/2015.
I hope this helps. You can use the same model to count periods of time functions, but you end up having to use the most logical date. You of course can count the total number of entities and compare this number of overlap over time to see if they overlap, but I digress...
-
Calculate the hours between 2 business days
Hi all
Do a complex calculation on the days I do not know how to achieve this.
Here is my case:
I have a week of work with hours of work.
Then there's this delivery time sheet for how long should be set an order ready to be delivered:
Order1: max 5 hours of work
Order2: max 8 working hours
Order3: max 16 hours of work
When an order is placed, the time of the order is recorded, and when an order has been set in ready to be delivered, this time is also registered.
How to calculate the time difference between the time where an order has been placed and the time where the order has been on loan. Thereby also taking into account the working days and hours of work.
Example: type order1 order was placed Tuesday at 15:00.
Order has been fixed loan Wednesday at 14:00
This means that to fix this ready order lasts 7 hours, which means that it is 2 hours time.
CREATE TABLE REF_WORKDAYS ( "WERKDAG" VARCHAR2(15 ) NOT NULL ENABLE, "SOORT_WERKDAG" VARCHAR2(15 ) NOT NULL ENABLE, "BEGIN_TIJD" VARCHAR2(10 ) NOT NULL ENABLE, "EIND_TIJD" VARCHAR2(10 B) NOT NULL ENABLE, )
Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Monday','WORKINGDAY','08:00','16:00'); Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Tuesday','WORKINGDAY','08:00','16:00'); Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Wednesday','WORKINGDAY','08:00','16:00'); Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Thursday','WORKINGDAY','08:00','16:00'); Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Friday','WORKINGDAY','08:00','16:00'); Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Satrurday','WORKINGDAY','08:00','14:00'); Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Sunday','NOT-WORKINGDAY','08:00','16:00'); COMMIT;
create table glas_order (order_id number , order_desc varchar2(100) not null , order_type varchar2(10) not null , order_date date not null , order_ready date );
Insert into GLAS_ORDER (ORDER_ID,ORDER_DESC,ORDER_TYPE,ORDER_DATE,ORDER_READY) values (1,'order bla','Order1',to_date('07-APR-15 09:00','DD-MON-RR HH24:MI'),to_date('08-APR-15 12:00','DD-MON-RR HH24:MI')); Insert into GLAS_ORDER (ORDER_ID,ORDER_DESC,ORDER_TYPE,ORDER_DATE,ORDER_READY) values (2,'order nice','Order1',to_date('14-APR-15 10:00','DD-MON-RR HH24:MI'),to_date('16-APR-15 16:00','DD-MON-RR HH24:MI')); Insert into GLAS_ORDER (ORDER_ID,ORDER_DESC,ORDER_TYPE,ORDER_DATE,ORDER_READY) values (3,'order ugly','Order2',to_date('18-APR-15 13:00','DD-MON-RR HH24:MI'),to_date('21-APR-15 09:00','DD-MON-RR HH24:MI')); COMMIT;
Thank you
Diana
Select
I like order_id
such as length d
order_type
d decode(order_type,'Order1',5,'Order2',8)
overtime
of glas_order o
model
Reference r on
(select
WERKDAG w
begin_tijd b
e eind_tijd
, (to_date (eind_tijd, 'HH24') - to_date (begin_tijd, 'HH24')) * 24 hard
of ref_workdays
where soort_werkdag = "WORKINGDAY")
dimension (w)
measures (b, e, hard)
main m
partition of (order_id I)
size of (0 n)
measures (0d, order_date, order_ready, cast (null as varchar2 (10)) as wday, order_type)
iterate (1e6) rules until (iteration_number > = trunc(order_ready[0]) - trunc(order_date[0])))
WDAY [0] = to_char (order_date [0] + iteration_number, 'FMDay', 'NLS_DATE_LANGUAGE = ENGLISH')
, d [0] = d [0] +.
case
When trunc(order_date[0]) = trunc(order_ready[0]) - beginning and ready same day
then presentv (r.b [wday [0]],)
less (largest (order_ready [0], to_date (to_char (order_date [0], 'YYYYMMDD') | r.b [WDAY [0]], 'YYYYMMDDHH24:MI')), to_date (to_char (order_date [0], 'YYYYMMDD') | r.e [WDAY [0]],'YYYYMMDDHH24:mi'))))
-bigger (to_date (to_char (order_date [0], 'YYYYMMDD') | r.b [WDAY [0]], 'YYYYMMDDHH24:MI'), least (order_date [0], to_date (to_char (order_date [0], 'YYYYMMDD') | r.e [WDAY [0]],'YYYYMMDDHH24:mi'))))))
0) * 24
When order_date [0] + iteration_number = order_date [0] - first day
then presentv (r.b [wday [0]],)
TO_DATE (to_char (order_date [0], 'YYYYMMDD') | r.e [WDAY [0]], 'YYYYMMDDHH24:MI')
-bigger (order_date [0], to_date (to_char (order_date [0], 'YYYYMMDD') | r.b [WDAY [0]],'YYYYMMDDHH24:mi'))))
0) * 24
When trunc(order_date[0]) + iteration_number = trunc(order_ready[0]) - last day
then presentv (r.b [wday [0]],)
less (order_ready [0], to_date (to_char (order_ready [0], 'YYYYMMDD') | r.e [WDAY [0]],'YYYYMMDDHH24:mi'))))
-to_date (to_char (order_ready [0], 'YYYYMMDD') | r.b [WDAY [0]], 'YYYYMMDDHH24:MI')
0) * 24
of another nvl (r.dur [wday [0]], 0)
end
)
ORDER_ID DURATION ORDER_TYPE OVERTIME 1 11 Order1 6 2 22 Order1 17 3 10 Order2 2 Rewrittten party rules for readability purposes (more resources)
measures (0d, order_date, order_ready, cast (null as varchar2 (10)) as to_date (null), (null) to_date, bd, order_type, wday ed)
iterate (1e6) rules until (iteration_number > = trunc(order_ready[0]) - trunc(order_date[0])))
WDAY [0] = to_char (order_date [0] + iteration_number, 'FMDay', 'NLS_DATE_LANGUAGE = ENGLISH')
, comics [0] = to_date (to_char (order_date [0] + iteration_number, 'YYYYMMDD') | r.b [WDAY [0]], 'YYYYMMDDHH24:MI')
, ed [0] = to_date (to_char (order_date [0] + iteration_number, 'YYYYMMDD') | r.e [WDAY [0]], 'YYYYMMDDHH24:MI')
, d [0] = d [0] +.
case
When trunc(order_date[0]) = trunc(order_ready[0]) - beginning and ready same day
then presentv (r.b [wday [0]],)
less (largest (order_ready [0], [0] bd), ed [0])
-Greatest (BD [0], least(ORDER_DATE[0],ED[0]))
0) * 24
When order_date [0] + iteration_number = order_date [0] - first day
then presentv (r.b [wday [0]],)
ED [0]
-Greatest(ORDER_DATE[0],BD[0])
0) * 24
When trunc(order_date[0]) + iteration_number = trunc(order_ready[0]) - last day
then presentv (r.b [wday [0]],)
least(order_ready[0],ED[0])
-bd [0]
0) * 24
of another nvl (r.dur [wday [0]], 0)
end
)
Jubilee should be Saturday I guessed.
-
Retrieve the duration of event "Sample profiling method.
Hello
I'm trying to understand how the JMC calculates the percentage of hot methods (which, according to the documentation, is the total time that the application has spent on the execution of code in the method), but the time I recover seem to be always zero and start and end timestamp is the same. The way I'm doing it follow below:
Registration of FlightRecording is FlightRecordingLoader.loadFile (new file ("jfr file path"));.
View IView = recording.createView ();
Map < String, IEventType > eventTypes = new HashMap < String, IEventType > ();
for (arisen event: view) {}
eventTypes.put (event.getEventType () .getName (), event.getEventType ());
}
view.setEventTypes (Arrays.asList (eventTypes.get ('profiling Sample method')));
for (arisen event: view) {}
System.out.println (Event.GetValue ("(Duration)") + "" + ((FLRMethod) event.getValue ("((stackTrace) .method)")) .getMethodName ());
}
Any clarification is very appreciated!
Thanks in advance.
The sample profiling method do not have a duration,
they are taken at intervals of 20 ms, for example, where a set number of threads is sampled.
All threads cannot be sampled, for example ones that run native code.
It really is "the percentage of the total number of samples taken in this method", which can be considered as an approximation of what the aide said "the percentage of the total time that the application passed on the execution of code in the method.
To get this regroup all the samples with the same Executive, there is not a single sample for each method with a total length of this method.
If you examine the event log and not activate Java Virtual Machine/method/profiling profiling sample in case types discovered, you will be able to see what kind of data you get.
-
Get the duration of pproTicksIn/pproTicksOut
Hello
I am trying to get the length of a clip of an exported finalcut pro xml first pro CC somehow it seems my next calculation is wrong. TICKS_PER_SECOND is 254,016,000,000 (Source Post).
TimeInSec = (pproTicksOut / TICKS_PER_SECOND)-(pproTicksIn / TICKS_PER_SECOND)
With the attached sample data which translates into TimeInSec = 37,32. Adobe Premiere shows duration for this clip from '00:00:36:20' (920 images).
Is someone able to explain, how to calculate the same duration as the first with an exported finalcut pro xml data?
Thank you very much
JW
Node ClipItem exported xml file example:
< clipitem id = 'clipitem-13051' frameBlend = 'FALSE' premiereChannelType 'stereo' = >
< masterclipid > masterclip-4999 < / masterclipid >
< name > Test_audio.wav < / name >
< enabled > TRUE < / enabled >
< duration > 3750 < / time >
rate <>
< timebase > 25 < / time base >
< ntsc > FALSE < / ntsc >
< / rates >
< start > 82 < / start >
-< end > 1 < / end >
< in > 0 < /in >
<>933 < / out >
< pproTicksIn > 0 < / pproTicksIn >
< pproTicksOut > 9479877120000 < / pproTicksOut >
< file id = "file-4999" / >
< sourcetrack >
Audio < mediatype > < / mediatype >
< trackindex > 1 < / trackindex >
< / sourcetrack >
< filter >
< effect >
Audio level < name > < / name >
audiolevels < effectid > < / effectid >
audiolevels < effectcategory > < / effectcategory >
audiolevels < effecttype > < / effecttype >
Audio < mediatype > < / mediatype >
< authoringApp parameter = "PremierePro" >
< parameterid > level < / parameterid >
< name > level < / name >
< valuemin > 0 < / valuemin >
< valuemax > 3.98109 < / valuemax >
< value > 0.530654 < / value >
< / parameter >
< / effect >
< / filter >
< link >
< linkclipref > clipitem-13051 < / linkclipref >
Audio < mediatype > < / mediatype >
< trackindex > 5 < / trackindex >
< clipindex > 1 < / clipindex >
< groupindex > 1 < / groupindex >
< / link >
< link >
< linkclipref > clipitem-13063 < / linkclipref >
Audio < mediatype > < / mediatype >
< trackindex > 6 < / trackindex >
< clipindex > 1 < / clipindex >
< groupindex > 1 < / groupindex >
< / link >
< logginginfo >
< description > < / description >
scene <>< / scene >
< shottake > < / shottake >
< filled > < / filled >
< / logginginfo >
<>labels
Caribbean < label2 > < / label2 >
< / Label >
< / clipitem >
< transitionitem >
< start > 990 < / start >
< end > 1015 < / end >
< Alignment > Center < / alignment >
< cutPointTicks > 121927680000 < / cutPointTicks >
rate <>
< timebase > 25 < / time base >
< ntsc > FALSE < / ntsc >
< / rates >
< effect >
< name > Cross Fade (+ 3dB) < / name >
< effectid > KGAudioTransCrossFade3dB < / effectid >
transition of < effecttype > < / effecttype >
Audio < mediatype > < / mediatype >
< wipecode > 0 < / wipecode >
< wipeaccuracy > 100 < / wipeaccuracy >
< startratio > 0 < / startratio >
< endratio > 1 < / endratio >
< reverse > FALSE < / back >
< / effect >
< / transitionitem >
<!-clipitems more->
Hi guys and thx for your answers
As Eddie was my confusion I could return to calculate the values to those displayed by the first. All the values are correct. But I think I did the tour of my problem now. Adobe includes / excludes also more transitionitem time in certain circumstances. After apply this logic I have my own code, I can get it even values as the first, heureka
Thanks again
-
Set the type of array on the duration... Get the error...
My requirement is
I try to set the table on the duration type. that is ortf_in_table_tbl {noformat} ({noformat} i).field_position_rec.ortf_segment_field_name to the code below.
But when I'm running code below and get below error:
Here field_position_cur gives me the name of column for the table EMP (i.e. field_position_rec.field_name) and field_position_cur give start and length to calculate the value of the columnDECLARE CURSOR field_position_cur (p_table_name VARCHAR2) IS SELECT xosf.field_name, xosf.starting_position, xosf.field_length FROM record_types xort, record_segments xors, segment_fields xosf WHERE xort.record_type_id = xors.record_type_id AND xors.record_segment_id = xosf.record_segment_id AND xosf.table_name = p_table_name; CURSOR raw_data_cur IS SELECT * FROM raw_data; TYPE raw_data_typ IS TABLE OF raw_data_cur%ROWTYPE INDEX BY BINARY_INTEGER; TYPE table_typ IS TABLE OF emp%ROWTYPE INDEX BY BINARY_INTEGER; table_tbl table_typ; raw_data_tbl raw_data_typ; BEGIN OPEN raw_data_cur; LOOP FETCH raw_data_cur BULK COLLECT INTO raw_data_tbl; EXIT WHEN raw_data_tbl.COUNT = 0; FOR i IN raw_data_tbl.FIRST .. raw_data_tbl.LAST LOOP FOR field_position_rec IN field_position_cur ('EMP') LOOP table_tbl (i).field_position_rec.field_name := SUBSTR (raw_data_tbl (i).raw_line_text, field_position_rec.starting_position, field_position_rec.field_length ); DBMS_OUTPUT.put_line ( 'table_tbl (i).field_position_rec.field_name ' || table_tbl (i).field_position_rec.field_name ); END LOOP; END LOOP; END LOOP; CLOSE raw_data_cur; FORALL i IN table_tbl.FIRST .. table_tbl.LAST INSERT INTO emp VALUES (table_tbl (i) ); COMMIT; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line ('OTHERS ' || SQLERRM); END; **ORA-06550: line 61, column 52:** **PLS-00302: component 'FIELD_POSITION_REC' must be declared** **ORA-06550: line 54, column 13:** **PL/SQL: Statement ignored**
i.e.
But it gives me error. We're on the 10g database.SUBSTR (raw_data_tbl (i).raw_line_text, field_position_rec.starting_position, field_position_rec.field_length )
Please suggest the solution for it.
Published by: BluShadow on January 12, 2012 08:21
addition of {noformat}{noformat} and other tags to make it readable. Please read {message:id=9360002} and learn to do this yourself.
Yes. Really recommend do you the suggested and especially medium provided the code and dynamic linking and loose curls.
-
Need help to calculate the start and end time and place the result in a term like text box
I did a search on the forum for calculating start and end time and found the code depending on which I am using as a formcalc on the duration field.
==============================================================
Form1. Page1.duration::calculate - (FormCalc, client)
If (HasValue (StartTime) and HasValue (EndTime)) then
industrial var = Time2Num (StartTime.formattedValue, "h: mm A")
var = Time2Num out_ (EndTime.formattedValue, "h: mm A")
If (IN2 > = out_) then
xfa.host.messageBox ("start time cannot be greater than or equal to the end time.")
$.rawValue = null
on the other
var out_ - IN2 = diff
$.rawValue = diff/3600000
endif
on the other
$.rawValue = null
endif
=============================================================
Then, when I enter for example from 15:30, an hour of beginning and end of 04:00
The duration field will say 0.5
How can I get my form to say 30 minutes instead of placing a decimal?
Secondly, how can I use field models LC where the employee can just type 330 or 03:30 and it automatically based on the computer's clock on time to start 15:30?
Any help will be greatly appreciated. Thank you.Attached is the form for display:
https://Acrobat.com/#d=f1kxh5qjuow5ujyZduF8OQ
To view the results in a regular time format, you can use:
$.rawValue = Num2Time (diff/3600000, "HH: mm")
For a flexible time entry check this example.
http://thelivecycle.blogspot.com/2011/05/flexible-Eingabe-von-Daten-und-Zeiten.html
-
How to calculate the second and minisecond for audio landmark
I'm doing a sound synchronization for the clip audio and video in Flash. I found a tutorial on the web, and it seems to work. However, I do not know how to calculate the second and the mini (deuxieme from mp3 file. The first frame has the following lines to set the duration for each animation:
Import class
Import net.quip.sound.SoundSync;
Stop the main timeline
Stop();
Create an instance of SoundSync
var ss:SoundSync = new SoundSync();
ss.addCuePoint ("IT", 20100);
ss.addCuePoint ("admin", 20000);
ss.addCuePoint ("maintenance", 19800);
ss.addCuePoint ("treatment", 16479);
ss.addCuePoint ("engineering", 14598);
as.addCuePoint ("logo_epa_npdes", 12356);
ss.addCuePoint ("construction", 8967);
ss.addCuePoint ("370 mg/j", 7896);
ss.addCuePoint ("mc_650, 000 ', 5439);
ss.addCuePoint ("130 mg/j", 3254);
ss.addCuePoint ("1938", 2439);
ss.addCuePoint ("vintage_mc", 0);
Use the instance of loading external MP3
ss.loadSound ("Scn04 - 05.mp3", true);
Create a listener object for the
cuePoint and onSoundComplete events
var listener: Object = new Object();
listener.cuePoint = function (): Void {}
Play();
}
listener.onSoundComplete = function (): Void {}
Play();
}
ss.addEventListener ("cuePoint", listener);
ss.addEventListener ("onSoundComplete", listener);
and the soundsync.as file as follows:
Import mx.events.EventDispatcher;
Import mx.utils.Delegate;
class net.quip.sound.SoundSync extends its {}
PROPERTIES
private var _cuePoints:Array;
private var _currentCuePoint:Number;
private var _interval:Number;
private var _intervalDuration:Number;
private var _secondOffset:Number;
Event dispatcher
public var dispatchEvent:Function;
public var addEventListener:Function;
private var removeEventListener:Function;
CONSTRUCTOR
public void SoundSync(target:MovieClip) {}
Super (target);
init();
}
METHODS
private function init (): Void {}
Initialize properties
_cuePoints = new Array();
_currentCuePoint = 0;
_intervalDuration = 200;
_secondOffset = 0;
Initialize the instance of the class as the valid event broadcaster
EventDispatcher.initialize (this);
}
Add Cue Point
public void addCuePoint(cuePointName:String,_cuePointTime:Number):Void {}
() _cuePoints.push
{
type: "cuePoint",.
name: cuePointName,.
time: cuePointTime,.
target: this
}
);
_cuePoints.sortOn ("time", Array.NUMERIC);
}
Get cue point
public void getCuePoint(nameOrTime:Object):Object {}
var counter: Number = 0;
While (counter < _cuePoints.length) {}
If (typeof (nameOrTime) == 'string') {}
If (_cuePoints [meter] .name == nameOrTime) {}
return _cuePoints [counter];
}
} Else if (typeof (nameOrTime) == 'number') {}
If (_cuePoints [meter] .time == nameOrTime) {}
return _cuePoints [counter];
}
}
counter ++;
}
Returns a null value.
}
Get the Index of the current Cue Point
private void getCurrentCuePointIndex(cuePoint:Object):Number {}
var counter: Number = 0;
While (counter < _cuePoints.length) {}
If (_cuePoints [meter] .name == cuePoint.name) {}
return the meter;
}
counter ++;
}
Returns a null value.
}
Get the next Cue Point index
private void getNextCuePointIndex(seconds:Number):Number {}
seconds (seconds) =? seconds: 0;
var counter: Number = 0;
While (counter < _cuePoints.length) {}
If (_cuePoints [meter] .time > = seconds * 1000) {}
return the meter;
}
counter ++;
}
Returns a null value.
}
Benchmark deleted
public void removeCuePoint(cuePoint:Object):Void {}
_cuePoints.splice (getCurrentCuePointIndex (cuePoint), 1);
}
Remove all Cue Points
public function removeAll_cuePoints (): Void {}
_cuePoints = new Array();
}
Beginning
public void start(secondOffset:Number,_loops:Number):Void {}
Super.Start (secondOffset, loops);
dispatchEvent ({type: "onStart", target: this});
Reset benchmark
_secondOffset = secondOffset;
_currentCuePoint = getNextCuePointIndex (secondOffset);
Poll for cue points
clearInterval (_interval);
_interval = setInterval (Delegate.create (this, pollCuePoints), _intervalDuration);
}
Load sound
public void loadSound(url:String,_isStreaming:Boolean):Void {}
super.loadSound (url, isStreaming);
clearInterval (_interval);
_interval = setInterval (Delegate.create (this, pollCuePoints), _intervalDuration);
}
Stop
public void stop(linkageID:String):Void {}
If {(linkageID)
Super.Stop (linkageID);
} else {}
Super.Stop ();
}
dispatchEvent ({type: "onStop", target: this});
Kill the ballot
clearInterval (_interval);
}
Survey benchmarks
private function pollCuePoints (): Void {}
If the current position is close to the cue point.
var time: Number = _cuePoints [_currentCuePoint] .time;
var span: Number = (_cuePoints [_currentCuePoint + 1] .time)? _cuePoints [_currentCuePoint + 1] .time: time + _intervalDuration * 2;
If (position > = time & & position < = span) {}
Send event
dispatchEvent (_cuePoints [_currentCuePoint]);
Advance to the next landmark...
If (_currentCuePoint < _cuePoints.length) {}
_currentCuePoint ++;
} else {}
_currentCuePoint = getNextCuePointIndex (_secondOffset);
}
}
}
EVENT HANDLERS
onSoundComplete
public function onSoundComplete (): Void {}
Kill the ballot
clearInterval (_interval);
Reset benchmark
_currentCuePoint = 0;
Send event
dispatchEvent ({type: "onSoundComplete", target: this});
}
}
any help will be greatly appreciated.Wuzhishan,
> Hi Dave, your tutorial is very cute and it is very useful.
Thank you! My daughter is cute. She inherited all of
me, so I have not left. ;)> I'm sorry that I don't have my question clearly.
No worries. :)
> I have listen mp3 in Windows Media Player and try to
> get both for the tail, I found it on the bottom of the
> player time indicates 00:26.I'm with you.
> How can I writer this number in the code? Is it 0026 or 26?
The code expects milliseconds, then 26 seconds would be written as
this:26000
If he said 01:22 (one minute and 22 seconds), you must write it like this:
82000
... which is 60 seconds for now, 22 seconds
side, then multiplied by 1,000 to get milliseconds.David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."
Maybe you are looking for
-
My Firefox does not recognize my Canon printer
Firefox 3.6 is not recognize my Canon MP640 printer; He repeated that the printer is not online. I have no problems printing emails using Thunderbird.
-
Satellite Pro A60: Generic Host Process for Win32 Services has encountered a problem
Satellite Pro A60 - Win XP Pro SP2.I recently started getting this error: "Generic Host Process for Win32 Services has encountered a problem and needs to close." We are sorry for the inconvenience. » and I was wondering if there are any known issues
-
Satellite Pro L300D ubuntu and Driver Chicony Webcam
Hi all Im having problems for my webcam to work on my Satellite Pro L300D laptop, its supposed to be for a Chicony b070.Before leaving, perhaps you should know Im using Ubuntu 8.04 Hardy Heron (still not improvement since this is a production machine
-
Hello everyone! I heard about videoconferencing in bbm, but I can't find any possibility to do this with my contacts. They use bbm in iphone and once I received an unexpected video call from them but then the video call has been interrupted without r
-
increase in size of the C drive after installing windows 8 pro, why?
my C drive partition volume is 92 Go, he had a lot of space before moving on to windows 8 from windows 7, after installation, I've seen the size of my c drive has only 5.33 GB free, why has happened?