Timestamp are compared with a number of hours

Hello

Need help with this question.

I want to compare a timestamp with a value like 24 or 36 hours.

For example:

Timestamp: 16 July 2010 13:00 ' in the 24 hours is pass (17 July 2010 13:05:10 ') so I want to update a table.

May we do this in pl/sql or Oracle 11G a function in there.

I'm grateful for the help.

Thank you.

First of all, we need to identify which wear out more don't get lines.
To do this, add a block of exception as shown below.

BEGIN
uDgrID := rowDGKR.id;
-- Search for record where drytime have reach the 24 or 36 hours.
select dgr.id, dgr.timestamp_placed, art.tijd
into nTmp, nTmp1, nTmp2
from gkr_droogkamer1 dgr, gkr_artikel art
where dgr.id = rowDGKR.id;
dbms_output.put_line('Selected id is -> '||ntmp);
if nTmp is NOT NULL Then
update gkr_droogkamer1
set result = 1
where 24 * (sysdate - nTmp1) > (select nTmp2 from gkr_artikel where id = uDgrId);
EXCEPTION
WHEN NO_DATA_FOUND THEN
dbms_output.put_line('No Data found for the id -> '||rowDGKR.id);
WHEN TOO_MANY_ROWS THEN
dbms_output.put_line('More than one row found for the id -> '||rowDGKR.id);

If the first dbms_output is printed, then the query that retrieves the extractions ntmp2 several lines of the first query itself is fetch more rows of tier.

Kind regards
Anthony Alix.

Tags: Database

Similar Questions

  • Search can't compare with the number to decimal

    Hi all

    you have a problem with 'Find '.

    I want to create an application that works average as mobile.

    So I take the Arith. Average of 30 blocks

    zaeler1         =  zaeler1 + 1
    zaeler2 = zaeler2 + 1
    statsel (6) = 'Yes '.
    Call StatBlockCalc ("Block", zaeler1 & "-" & zaeler2, "[" & ChannelNr & "] / I_ '& pruefling & '\15'")
    arithmean = StatArithMean

    then I add an offset as the limit (upper limit here)

    sum             =  ioben + arithmean

    so, I want to find the measure that does not fit.

    intmyresult    =  find ("Ch (" "[" & ChannelNr & "" "] / I_" example & "\15" "" ") ' >" & (arithmean) & "", morefail ")

    but the line with fin produce an error. :

    "

    Find ("ch("[1]/I_4812\15") > 1,415"", 2) down rights Klammer").

    "

    I use Diadem 14.0

    Someone at - it an idea?

    Thank you

    Michael

    Hi Michael,

    Brad is right that it is difficult to debug the convoluted formulas, but I would give it a try

    intmyresult    =  find ("Ch (" "[" & ChannelNr & "" "] / I_" example & "\15" "" ") ' >" & (arithmean) & "", morefail ")

    I guess you're in DIAdem SCRIPT and not in the calculator? If so, I think that your conversion of 'arithmean' is incorrect (in case you have a German localization of Windows):

    What happens if you write? :

    Call Msgbox (arithmean)

    For me, the result is:

    1 415' comma!

    Is it the same for you too?

    If so, your channel has an extra comma and is misinterpreted by FIND.

    Please try to write:

    Str (arithmean)

    Instead of

    (arithmean)

    I hope that helps you along!

    Best regards

    Christoph

  • In subtracting two stamps, and indicating the number of hours between them.

    Hello people,

    I have two tables, each of them has a timestamp column. I want to do a select with a join that will show a column with the number of hours between the two times.

    (I added the columns as timestamp (0) since I have no need for decimals)

    Here's what I have:

    a table name: conc_test

    table information:

    P_DATE---JOB_NO---MIX---POUR_NO---AMB_T---CONC_T--SLUMP---AIR---DENSITY---CYL_CAST_TIME
    09-MAR-10---9-12-796---80---100309A---2.5---16---135---2.5---2501---09-MAR-10 AM 10.00.00

    the two table name: rls_break

    Info table two:

    JOB_NO---POUR_NO---CYL_ID---SPEC_STR---STR---MIX---BREAK_D_T
    9-12-796---100309A---100309A1---20---27---80---10-MAR-10 07.15.00 AM

    (I put the - between columns, so it would be more readable to reading the forum, FYI)

    That's what I was trying to do:

    Select
    rls_break.cyl_id "Cylinder ID",
    rls_break. Mix "Mix."
    trunc(rls_break.break_d_t-conc_test.cyl_cast_time) 'Age. '
    rls_break.spec_str '' appropriate Force. ''
    rls_break. Str "Specimen Strength".
    from rls_break inner join conc_test on rls_break.pour_no = conc_test.pour_no
    where pour_no = '100309A ';.


    I want the column 'Age' to display the total number of hours between (cyl_cast_time of the conc_test column) cast time and pause time (column break_d_t of rls_break)


    I thank the of for any help.
    ...
    extract(day from rls_break.break_d_t-conc_test.cyl_cast_time)*24
     + extract(hour from rls_break.break_d_t-conc_test.cyl_cast_time)
     + extract(minute from rls_break.break_d_t-conc_test.cyl_cast_time)/60
     + extract(second from rls_break.break_d_t-conc_test.cyl_cast_time)/(60*60) "Age",
    ....
    
  • How to update the table with the number management

    Hello

    I need as there is a loc_tab of the created table as below,

    CREATE TABLE loc_tab
    (
    Country_ID NUMBER,
    country_code VARCHAR2 (3),
    country_name VARCHAR2 (50).
    State_ID NUMBER,
    state_code VARCHAR2 (3),
    state_name VARCHAR2 (50).
    city_id NUMBER,
    city_code VARCHAR2 (3),
    city_name VARCHAR2 (50)
    );

    I inserted records like below,
    COUNTRY_ID     COUNTRY_CODE     COUNTRY_NAME     STATE_ID     STATE_CODE     STATE_NAME     CITY_ID     CITY_CODE     CITY_NAME
    
              IND          INDIA                    TN          TAMIL NADU          CHN          CHENNAI
              IND          INDIA                    TN          TAMIL NADU          TRI          TRICHY
              IND          INDIA                    TN          TAMIL NADU          CMT          COIMBATORE
              IND          INDIA                    TN          TAMIL NADU          MDU          MADURAI
              IND          INDIA                    AP          ANDHRA PRADESH          HYD          HYDERABAD
              IND          INDIA                    AP          ANDHRA PRADESH          SEC          SECUNDRABAD
              AUS          AUSTRALIA               QLD          QUEENSLAND          BRI          BRISBANE
              AUS          AUSTRALIA               TAS          TASMANIA          HB          HOBART
              AUS          AUSTRALIA               TAS          TASMANIA          CCE          CITY OF CLEARANCE
              AUS          AUSTRALIA               TAS          TASMANIA          BUR          BURNIE
    Now, I wanted to update the table such that all ID columns are updated with running number.

    Each ID columns should get incremented so that, for Country_ID column corresponding to "India" If country_id is 1, that there must be one for all the lines with the name as "India". Likewise for "Australia".

    In the case of State, she also has the same logic with numbers repeated until the very name of the State comes.

    For the city, it of course will hold separate ID only because the name of the city will not get duplicated.

    This update must be done in the normal way using simple SQL such as no PLSQL don't like looping, etc... is involved.

    Here are the contents of the table, and that's how the table should be updated,
    COUNTRY_ID     COUNTRY_CODE     COUNTRY_NAME     STATE_ID     STATE_CODE     STATE_NAME     CITY_ID     CITY_CODE     CITY_NAME
                                            
    1          IND          INDIA          1          TN          TAMIL NADU     1     CHN          CHENNAI
    1          IND          INDIA          1          TN          TAMIL NADU     2     TRI          TRICHY
    1          IND          INDIA          1          TN          TAMIL NADU     3     CMT          COIMBATORE
    1          IND          INDIA          1          TN          TAMIL NADU     4     MDU          MADURAI
    1          IND          INDIA          2          AP          ANDHRA PRADESH     1     HYD          HYDERABAD
    1          IND          INDIA          2          AP          ANDHRA PRADESH     2     SEC          SECUNDRABAD
    2          AUS          AUSTRALIA     1          QLD          QUEENSLAND     1     BRI          BRISBANE
    2          AUS          AUSTRALIA     2          TAS          TASMANIA     1     HB          HOBART
    2          AUS          AUSTRALIA     2          TAS          TASMANIA     2     CCE          CITY OF CLEARANCE
    2          AUS          AUSTRALIA     2          TAS          TASMANIA     3     BUR          BURNIE
    Thank you and best regards,
    Shiva
  • Number of hours of the weekend between two timestamps

    I'm trying to take two timestamps and the total number of hours weekend between them.  For example:

    Between October 23, 13 08.28.00.000000 AM and 28 October 13 04.48.25.424940 PM, there are two weekend days.  I want the query to return the 48 hours.

    Between October 24, 13 04.48.25.424940 PM and 01.00.00.000000 October 27, 13 h ago weekend day plus 13 hours Sunday, I would that this return to 37 hours.

    Database version:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    "CORE 11.2.0.3.0 Production."

    AMT for Linux: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    Create / Insert statements:

    CREATE TABLE 'TDIFF.

    (NUMBER OF 'ID',

    "TS1' TIMESTAMP (6).

    ('TS2' TIMESTAMP (6));

    Insert into TDIFF (ID, TS1 and TS2) values (1, to_timestamp (17 October 13 02.09.01.818304000 PM ',' DD-MON-RR HH.MI.)) PSM AM FF'), to_timestamp (30 October 13 09.16.00.000000000 PM ',' DD-MON-RR HH.MI.) PSM AM FF '));

    Insert into TDIFF (ID, TS1 and TS2) values (2, to_timestamp (21 October 13 01.23.58.258494000 PM ',' DD-MON-RR HH.MI.)) PSM AM FF'), to_timestamp (24 October 13 10.00.00.000000000 AM ',' DD-MON-RR HH.MI.) PSM AM FF '));

    Insert into TDIFF (ID, TS1 and TS2) values (3, to_timestamp (07.33.10.874721000 AM October 23, 13 ',' DD-MON-RR HH.MI.)) PSM AM FF'), to_timestamp (24 October 13 10.00.00.000000000 AM ',' DD-MON-RR HH.MI.) PSM AM FF '));

    Insert into TDIFF (ID, TS1 and TS2) values (4, to_timestamp (09.12.41.928313000 AM October 23, 13 ',' DD-MON-RR HH.MI.)) PSM AM FF'), to_timestamp (25 October 13 02.30.00.000000000 PM ',' DD-MON-RR HH.MI.) PSM AM FF '));

    Insert into TDIFF (ID, TS1 and TS2) values (5, to_timestamp (10.12.22.790736000 AM October 23, 13 ',' DD-MON-RR HH.MI.)) PSM AM FF'), to_timestamp (24 October 13 06.40.00.000000000 PM ',' DD-MON-RR HH.MI.) PSM AM FF '));

    Insert into TDIFF (ID, TS1 and TS2) values (6, to_timestamp (10.33.20.879307000 AM October 23, 13 ',' DD-MON-RR HH.MI.)) PSM AM FF'), to_timestamp (25 October 13 04.24.00.000000000 PM ',' DD-MON-RR HH.MI.) PSM AM FF '));

    Insert into TDIFF (ID, TS1 and TS2) values (7, to_timestamp (11.01.23.467642000 AM October 23, 13 ',' DD-MON-RR HH.MI.)) PSM AM FF'), to_timestamp (24 October 13 07.00.00.000000000 AM ',' DD-MON-RR HH.MI.) PSM AM FF '));

    Insert into TDIFF (ID, TS1 and TS2) values (8, to_timestamp (23 October 13 04.45.08.237177000 PM ',' DD-MON-RR HH.MI.)) PSM AM FF'), to_timestamp (07.00.00.000000000 AM October 25, 13 ',' DD-MON-RR HH.MI.) PSM AM FF '));

    Insert into TDIFF (ID, TS1 and TS2) values (9, to_timestamp (23 October 13 04.48.25.424940000 PM ',' DD-MON-RR HH.MI.)) PSM AM FF'), to_timestamp (28 October 13 08.28.00.000000000 AM ',' DD-MON-RR HH.MI.) PSM AM FF '));

    This is what I have so far, but his return the number of incorrect hours:

    SELECT TS1,TS2,
      (SELECT COUNT(*)
       FROM DUAL
       WHERE TO_CHAR(TS2 + LEVEL - interval '1' hour, 'DY') IN ('SAT', 'SUN') 
    CONNECT BY LEVEL <= 24*extract(DAY FROM TS2-TS1)+extract(hour FROM TS2-TS1) + 1 ) D1_WEEKEND_HOURS
    FROM TDIFF
    

    Any ideas are appreciated.

    -Steve

    Here is another way, assuming a definition of the weekend as strictly between midnight Friday and midnight Sunday:

    The interval of D1 to D2 can be considered be allowed between the D1 and the next 00 Monday more time between Monday preceding the D2 and D2 as well as the weeks between the two Monday to 00:00.

    select  id, ts1, ts2,
    ( least(7 + (trunc(CAST(ts1 as DATE), 'IW') - CAST(ts1 as DATE)), 2) /* ts1 to Monday */
    + greatest( (CAST(ts2 as DATE) - trunc(CAST(ts2 as DATE), 'IW')) -5, 0) /* Monday to ts2 */
    + 2/7 * (trunc(CAST(ts2 as DATE), 'IW') - trunc(CAST(ts1 as DATE), 'IW') -7 ) /* Weeks between Mondays */
    ) * 24
    from TDIFF
    
  • How the program e-mail later in compare with Google GMail, especially in the treatment of spam or are both about the same?

    How the program e-mail later in compare with Google GMail, especially in the treatment of spam or are both about the same?

    Firefox does not include an email client. You ask about the suite Seamonkey? Seamonkey support options are here: http://www.seamonkey-project.org/community

  • What are the advantages and disadvantages of using iCloud drive (or other Cloud services) compared with iTunes game against external hard drive, Solid State etc. to store my songs iTunes, playlists, ratings etc?

    First question: what are the advantages and disadvantages of using iCloud drive (or other Cloud services) compared with iTunes Match against Solid State external hard drive etc to store my songs iTunes, playlists, ratings etc?

    Please let me know what are the alternatives for storage of my songs, playlists, song etc. other than iTunes game ratings ($ 24.99 / year)?  Is there a way to store all my songs with my song ratings, playlists, etc. with a CD song quality? Most of my (currently 130 GB) songs on my computer are CD quality that I prefer to keep as well as my notes of each song (i.e. 5 * vs. 4 * etc.), playlists, groups (music, classical, popular, country etc.).  What are the advantages and disadvantages to store my iTunes songs while CD quality with my personal notes, reading lists, groupings in the cloud?  ICloud of Apple Drive ($ 2.99 per month or $36 / year for 200 GB) would be the best way to automatically update and maintain my rankings iTunes personal including the future editions of the song etc or using Amazon, IBM, Microsoft etc cloud or an external hard drive SSD would work as well and maybe cheaper?  I currently have my iTunes on a PC of 2007 with vista (I use a 1 8T Western Digital external upward by car for my personal info all over HP, songs, photos etc. which is currently close to 170 GB) but also have an Apple i-phone 6 & I Air cushion.  Although I did not need to have all of my music with all their sides, etc. available on all of my devices at all times as iTunes game, I still would have easy access to information on both my PC and my iPhone or iPad?  Thank you.

    In my opinion?

    I back up my data to an external drive for several reasons.  The first is my data - if I put on the cloud, someone else has control over it, they can see what I have and change the preferences to what they see of marketing.

    Almost as important as that - if I had to rely on the cloud whenever I wanted to update my playlists on my phone, I need a better internet connection I have now (working at sea).  To get the best out of the cloud, you need a solid link to home, work or mobile.

    As a spin-off - I hate the fact that Apple take away a feature in their software updates and then allow an app to be sold in their store to replace this feature - or worse still, some features that were available before the updates are now "cloud only."  And Yes - you have to pay for the cloud.  I like most of the people do not appreciate the 'accomplished fact. "

    From the back of the external hard drive ASI downside, is that to be safe, you need to store outside in a separate computer place.  If keep you them together, if one is lost, probably, they are both.  That is to say for me a full backup before you travel, then a new upward as soon as I go home.  Downside is how much data may be lost between the two back ups if I needed to restore.  For me, its worth the risk.  If I was away and say had bought a ton of new music and couldn't go home anytime soon, I can always head to the store and buy a new external drive, they are massively expensive.  Even if my computer has to go for repair and my remote is to halfway around the world - I want to buy a new one.

    Now, some will say that once you buy a new external, you spend more than you would on a cloud subscription.  It's true, but in the 6 years following the purchase of Mac that I've only had to buy a new external once - so with a little luck and planning - it works.

    I left took well - I am not a subscriber of cloud, nor do I want to be.

  • My computer crashed and I tried to re-download CS6. I have a serial number for CS6. but it does not work. I noticed that there are several versions of CS 6. Which version goes with serial number [removed]? I downloaded the stand of design «»

    I have a serial number for CS6. but it does not work. I noticed that there are several versions of CS 6. I downloaded 'standard design', but it did not work. Which version goes with serial number [removed]?

    Thank you

    Bill Heinsohn

    Check your Adobe account online.  If you have registered the software version should be shown there.

    Never share your serial number publicly... anyone can use it.

  • I can't find my code redemption cs6 and I just bought a new computer because my old one no longer works. How can I get my photoshop on this computer? All my products are registerd with a serial number

    I can't find my code redemption cs6 and I just bought a new computer because my old one no longer works. How can I get my photoshop on this computer? All my products are registerd with a serial number

    For CS and CS2 activation servers stopped working and have been taken down. You will need to take a look at this link for your question: https://helpx.adobe.com/x-productkb/policy-pricing/creative-suite-2-activation-end-life.ht ml

    Benjamin

  • IsDefined dislikes the names of variables beginning with a number. Unless they are defined...

    Hello

    I detected a strange (for me) behavior of the IsDefined function. I have something like:

    < cfif IsDefined ("url.vose") > < cfset = "value" unevariable > < / cfif >

    < cfif IsDefined ("url.3d") > < cfset = "value" unevariable > < / cfif >

    * If url.3d is set, all right. All work as expected.

    * If url.3d is not defined, CF throws an error "Parameter 1 of function IsDefined, which is now url.3d, must be a syntactically valid variable name".

    * If I use structKeyExists (url, "3d") instead of IsDefined("url,3d"), works as expected.

    I have tried different combinations of variable names and extended (EP, url.5d, or form.3d) and the problem seems to be the number at the beginning of the name of the variable.

    This is the expected behavior? I found it very strange that it works if the variable exists and only generates an error if not. Can it be considered a bug and should be reported?

    TIA,

    It doesn't matter if the language is CF or JavaScript or PHP-HTML - variable names are considered invalid if they do not begin with a letter or underscore.  You must friezer prefix a variable name with a number.

    Also, I have heard many developers complain IsDefined().  Use rather StructKeyExists().

     blah blah blah 
    
     blah blah blah 
    

    V/r,

    ^_^

  • Compare the result of a query with a number and return a message

    Hello
    I have the following query in oracle 9i:

    SELECT COUNT (*)
    OF hourly_files
    WHERE date_received = TO_DATE ((SELECT TO_CHAR (SYSDATE - INTERVAL '1' DAY, 'DDMMYYYY')
    (THE DOUBLE), 'DDMMYYYY');

    This will produce a number of lines required

    I need to compare the number of output with another number hardcoded (threshold) and print an appropriate example message

    If the result of the query above is 18000 and the number of threshold is fixed at 20000, then output a meesage:

    Number of files received less than 2000

    Any help will be very appreciated!

    Thank you.
    SQL> ed
    Wrote file afiedt.buf
    
      1  SELECT CASE WHEN COUNT(*) >5 THEN 'Number is > than 5'
      2              WHEN COUNT(*) <1 THEN 'Its less than 1'
      3  ELSE 'Its in between'
      4  END
      5  FROM emp
      6* WHERE deptno=20
    SQL> /
    
    CASEWHENCOUNT(*)>5
    ------------------
    Its in between
    
    SQL> SELECT COUNT(*) FROM emp
      2  WHERE deptno=10;
    
      COUNT(*)
    ----------
             3
    
  • What are the benefits of Adobe Muse in compare with Axure?

    Try to find advantages of Adobe Muse to compare with Axure

    Hello, HBH,

    I want to stress that I would like to draw your attention: Muse > Dreamweaver, even if:

    A few months ago we discussed this question here in the forum. Unfortunately, I didn't keep this thread. But here's a video of YouTube, where Janine Warner ", highlights the difference between Dreamweaver CC": http://www.youtube.com/watch?v=FHbFLwutUGk.

    ... and so for my part, I prefer DW CC.

    Hans-Günter

  • Remove rows older than the number of hours given

    Hello

    I'm a student of the table that contains the following columns

    ID Number (5)
    Name varchar2 (20)
    Strt_Time timestamp (6)

    Strt_time is the timestamp when the individual is inserted in the table.

    I need a query to delete all the lines that are inserted before considering the specific number of hours.

    For example. If I pass the input as 2 parameter all lines that are inserted before 2 a.m. now should get deleted.

    Hello

    944160 wrote:
    ... I need to spend many hours as the query parameter, and I struggle to execute the below query

    What front end do you use? How you are and passing the parameter? The example that I gave

    REMOVE FROM STU
    WHERE STRT_TIME< systimestamp="" -="" numtodsinterval="" (:num_hours,="">

    works in SQL * Plus (among others), assuming you have previously set and the value of the variable binding: num_hours in the same session. For example:

    VARIABLE  num_hours    NUMBER;
    EXEC     :num_hours := 2;
    
    DELETE  FROM STU
    WHERE     STRT_TIME < SYSTIMESTAMP - NUMTODSINTERVAL (:num_hours, 'HOUR');
    

    Instead of a link as variable: num_hours, you can use an expression that evaluates to a NUMBER, including


    • SQL * more variable substitution
    • a scalar subquery involving any one or more tables
    • a pacakge PL/SQL variable
    • a function call
    • a combination of the foregoing, by using CASE and/or arithmetic operators, such as + and -.

  • Count the number of hours between the dates off holiday/weekend

    Hi all

    I've not worked with dates and was recently asked to create a report where I am looking for the number of hours between two dates only count business days.

    So for example I have given as follows

    Created on 2011-03-30 15:00
    Treaty of 2011-03-30 15:03:46
    Filled 2011-04-01 17:25:02
    Posted 2011-04-01 17:45

    For a total of looking for the CREATION and dates

    50 hours and 45 minutes

    IM also trying to exclude weekends and holidays, I read around and was able to also find an array of dates where I main date, the HOLIDAY_IND column, and the column WEEKDAY_IND

    If the calendar table I have looks like

    CALENDER_DATE HOLIDAY_IND WEEKDAY_IND
    2011-03-31 YY
    2011-04-01 N Y
    2011-04-02 N N

    IM really very puzzled to know where to start

    I thought I'd try to write with PL/SQL, but I don't have access of the user to create procedures/functions, so looks like right up to SQL

    Any help is appreciated!

    Hello

    Depeneding on your data and your needs, you can do something like this:

    SELECT     created_DATE,
    ,     mailed_date
    ,     24 * ( (mailed_date - created_date)
              - (
                SELECT  COUNT (*)
                FROM        table_o_dates
                WHERE    main_date > created_date
                AND        main_date < TRUNC (mailed_date)
                AND        (   holiday_ind = 'Y'
                         OR  weekday_ind = 'N'
                      )
              )
               )               AS hours_between
    FROM     table_x
    ;
    

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all tables and also post the results desired from these data.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.

    What do you do if created_date or mailed_date is not a working day? Examples in you data and results.

  • Multiply the time (for example00:10) with a number

    Hello

    I have the query shows
    datatype of act_hour and act_ovt  is varchar2
    select to_char(DATE_ENTRAY,'DY') day,
    CASE WHEN to_char(DATE_ENTRAY,'DY') = 'FRI' THEN act_hour ELSE  act_ovt END  Over_Time,Date_Entray , act_hour,insert_type
        act_ovt 
    from NAP_PUNCH_DATA_EMP_LIST
    
    
    Date_Entray  act_hour    act_ovt  day   Over_Time  Insert_type 
    8/1/2010     08:35      00:05   SUN    00:05      
    8/2/2010     08:36      00:06   MON    00:06
    8/3/2010     08:35      00:05   TUE    00:05
    8/4/2010     08:33      00:03   WED    00:03
    8/5/2010     08:34      00:04   THU    00:04
    8/6/2010     10:32      02:02   FRI    10:32
    9/19/2010    10:00      01:00   SAT     10:00     H
    
    i require to compute  a new field OVT_HRS  ie if  a person works on  normal working day(with exception of friday) his OVT_HRS is Over_time*1.25
    if a person works on  friday his OVT_HRS  will be over_time*1.5
    if a person works on holiday(when insert_type is H) then  OVT_HRS  will be  Over_time *2
    I TRIED but comes invalid number
    Case when insert_type='H' then Act_ovt*2 
       when to_char(DATE_ENTRAY,'DY') = 'FRI' then ACT_HOUR *1.25
          ELSE Act_ovt*1.25
          end OVT_HRS,
    
    could someone guide me in doing the the above step where a data of 00:01 format is mulitplied by a number     ,act_ovt  and act_hour are of datatype varchar2                              
    kindly help me
    thanking in advance

    Published by: makdutakdu on October 4, 2010 15:08

    Published by: makdutakdu on October 5, 2010 07:21

    Something to play with

    select :hh hours,
           lpad(to_char(trunc(:hh)),2,'0')  || ':' || lpad(trunc(60 * (:hh - trunc(:hh)),2),2,'0') truncated,
           lpad(to_char(trunc(:hh)),2,'0')  || ':' || lpad(round(60 * (:hh - trunc(:hh)),2),2,'0') rounded,
           lpad(to_char(trunc(:hh)),2,'0')  || ':' || lpad(ceil(60 * (:hh - trunc(:hh))),2,'0') being_generous
      from dual
    

    Concerning

    Etbin

Maybe you are looking for

  • Toshiba Satellite A60 doensn can't go more

    Dear users of Toshiba, I bought a "new" Toshiba Satellite A60 4 days ago.and I brought in the Ireland. It worked fine for 2 days and after that the computer on standby modus. Once the adapter has been designed, it no longer meets the key power button

  • Need help recovery product

    Hello I need to make a product recovery and as a non-technical Silver Surfer, I'm very nervous about doing things.So far, I've kept all my data files, but I don't know how to save my favorites and all my messages in outlook.Due to the validation erro

  • For Clip Zip fast SD card? Which one to buy

    Hello I'm looking for a new sd card for my clipzip 8 GB - 16 GB more preference. Update the file system on my old (now defunct) sd card took a considerable amount of time, I would like to know what the best (= faster) for a clipzip is. Any suggestion

  • Upgrade HP Pavilion keyboard and palmrest of series 2000 g6-1d98dx

    Hello world! I have a HP Pavilion Notebook PC g6-1d98dx and my keyboard started to fail. I wonder if I can change the keyboard to a life-size like the one on the HP Pavilion laptop 2235us g6, because it has a larger keyboard with numeric keypad. I kn

  • Printer HP Officejet Pro 8600 Plus works but the Scanner does not

    I recently bought a Toshiba laptop with Windows 7 Home Premium operating system.  My previous laptop is a Toshiba also upgraded to Windows 7 Home Premium operating system.  I have a printer HP Officejet Pro 8600 more all-in-one printer.  The printer/