How to write if another logic using time

Hai All

I have genetating a daily presence for employees, then there are three teams in the company

0815 to 1645, 1200 to 2000 & 1715 at 0145


So first quarter begins a.m. 0815 so I took just before an hour and after a time (0715 to 0915) means so intimate for all trips even.

And there is a pause inbetween time travel, as of now, I coded for only the first post and works very well.


declare
Cursor c1 is
Select the barcode, BARDATE, BARTIME
Of temp_attendance
Group of barcodes, bardate, bartime
ORDER BY barcode, bartime.

Start
to r1 c1 loop
If r1.bartime between 0631 and 0930 may
insert into dail_att (barcode, respondent, attend_date) values
(r1.barcode, r1.bartime, r1.bardate);
on the other
For r in (select empcode, empname, barcode, intimate, intrtimein, introuttime, addin, addout, outtime, dail_att attend_date) loop
If r.intrtimein is null then
Update dail_att set intrtimein is r1.bartime where barcode = r1.barcode and attend_date = r1.bardate and intimate is not null;.
elsif r.intrtimein is not null and r.introuttime is null then
Update dail_att set introuttime = r1.bartime where barcode = r1.barcode and attend_date = r1.bardate and intimate is not null and intrtimein is not null;
elsif r.intrtimein is not null and r.introuttime is not null and r.addin is null then
Update dail_att set addin is r1.bartime where barcode = r1.barcode and attend_date = r1.bardate and intimate is not null and that intrtimein is not null and introuttime is not null;.
elsif r.intrtimein is not null and r.introuttime is not null and r.addin is not null and r.addout is null then
Update dail_att set addout is r1.bartime where barcode = r1.barcode and attend_date = r1.bardate and intimate is not null and intrtimein is not null and introuttime is not null and addin is not null;.
elsif r.intrtimein is not null and r.introuttime is not null and r.addin is not null and r.addout is not null and r.outtime is null then
Update dail_att set outtime is r1.bartime where barcode = r1.barcode and attend_date = r1.bardate and intimate is not null and intrtimein is not null and introuttime is not null and addin is not null and addout is not null;.
end if;
end loop;
end if;
end loop;
commit;
end;


When I use it once works very well and the next day when I added the next synchronization in the if clause

If r1.bartime between 0631 and 0930 and r1.bartime between 1100 and 1300

his does not work very well because some employees died in 1230 for interval and its addition of a new line it was not updated in the same line


Then tell how to write some conditional for that

Thanks in advance

Srikkanth.M

Hi Srikanth,

Please use the code tags to your zip code.
Can you specify your requirement as to what should be the output and under what conditions with some examples of data?

Tags: Database

Similar Questions

  • How to write if another logical condition in time datatype

    Oracle forms6i
    Hai

    I'm generating a form.i need for certain if attendance logic to run my form pls tell me.

    I have a table called bar_code and the area is barcode, empcode, bartime, bardate in this table, I need to generate a table of daliattendance using barcodes, bardate, bartime.
    Since the bartime I need to calculate it's intimate, or outtime. I have generated table bar_code text file, so the text file contain only a day information. So he starts the synchronization from 0145 am. 0145 means outtime because it is the respondent to intime0500pm yesterday. And general development starts from 0815 to 0445 and 0515 at 0145 the next day night and noon 1200 to 2000.

    This is my encoding

    Begin
    go_block ('TEST_SRI');
    PREMIER_ENREGISTREMENT;
    LOOP
    If: barcode is not null then
    Update dail_att
    the value of timeout =: bartime
    where = barcode: barcode
    and timein is not null
    and ATTEND_DATE =: BARDATE and: bartime between 0145 and 0600.
    If sql % notfound then
    insert into dail_att (barcode, timein, attend_date, empcode)
    -values(:barcode,:bartime,:bardate);
    Select the barcode: bartime,: bardate, dail_att empcode where
    = barcode: barcode and: bartime between 0730 and 0900 and: bartime between 0445 and 600;
    -order of empcode, timein barcode;
    -insertion in emplcode select dail_att (empcode) of bar_code;
    end if;
    end if;
    WHEN THE OUTPUT: SYSTEM. LAST_RECORD = "TRUE" OR: BAR CODE IS NULL;
    clear_RECORD;
    END LOOP;
    forms_ddl ('commit');
    exception
    while others then
    -forms_ddl('rollback');
    message(SQLERRM|| dbms_error_Text);
    message(SQLERRM|| dbms_error_Text);
    -forms_ddl('commit');
    clear_record;
    End;

    Concerning

    Srikkanth.M

    You can try something like this

     case when
    (to_date(:bartime,'hh24mi') between to_date('0630','hh24mi') and to_date('0900','hh24mi') )
            or
            (to_date(:bartime,'hh24mi') between to_date('1200','hh24mi') and to_date('1300','hh24mi') )
            then
            bool_is_intime:=true;
      else
            bool_is_intime:=false;
      END case;
    
    if bool_is_intime then
    
        
    
    else
    
       
    end if;
    

    the case where the tree is of course more complex in your case casue you have a 3rd shift I do not understand... It may be just something like

    or (to_date(:bartime,'hh24mi') >= to_date('1730','hh24mi') )
    

    P.S. forgot to mention that the bool_is_intime of variables must be declared as boolean

    Published by: Luka on January 21, 2010 11:55

  • How to write a JSON file using edge

    I'm doing a simple blog system,

    I thought a JSON file would be the easyest, but if there is a better way please tell me

    I already know how read a. JSON file using $.getJSON ("filename", function (data) {});

    but I need to know if it is possible to write to the same file.

    Thanks for help.

    All writing in a file involves php or something similar.

  • How to help if another logic

    Hai All

    My name from the table called Daily_attend

    The fields are intimate, intrinsically introut, outtime

    For example

    There are four different calendar

    0815

    1200

    1245

    1800

    I have four now and now these four times I need to store in my table according to a logic

    If Min time is respondent
    Insert into

    If intrinsically is null and intimate is not null then

    Update

    If introut is null and intimate is not zero then, and intrinsically is not null then

    Update

    If the time Max is outtime
    Update

    I tried this logic, but I did not get this result

    My expectation

    Intrinsically intimate introut outtime

    0815 1200 1245 1800


    Tell me, using logical expression

    Concerning

    Srikkanth.M

    If your version is 11g, then you can do it with pivot. you don't have to write a pl/sql block.

    select * from t1;
    
    BARC BARDATE   BART
    ---- --------- ----
    0011 10-JAN-10 0815
    0011 10-JAN-10 1215
    0011 10-JAN-10 1245
    0011 10-JAN-10 1715
    0022 10-JAN-10 0845
    0022 10-JAN-10 1815
    0033 10-JAN-10 0715
    0033 10-JAN-10 0915
    
    8 rows selected.
    
    --------
    
    select * from t2;
    
    EMPNAME                 EMPCODE INTI INTR INTR OUTT ATTEND_DA BARC
    -------------------- ---------- ---- ---- ---- ---- --------- ----
    EMP_NAME1                     1                     10-JAN-10 0011
    EMP_NAME2                     2                     10-JAN-10 0033
    EMP_NAME3                     3                     10-JAN-10 0022
    
    3 rows selected.
    
    -----------
    
    UPDATE t2 SET (barcode,attend_date,intime,introut,intrin,outtime) = (SELECT barcode,bardate,INTIME,INTROUT,INTRIN,OUTTIME FROM (
    SELECT barcode,bardate,bartime,
    CASE
    WHEN rn=1 THEN
    'INTIME'
    WHEN rn=2 AND rn != max_val THEN
    'INTROUT'
    WHEN rn=2 AND rn = max_val THEN
    'OUTTIME'
    WHEN rn=3 AND rn != max_val THEN
    'INTRIN'
    WHEN rn=3 AND rn = max_val THEN
    'OUTTIME'
    WHEN rn=4 THEN
    'OUTTIME'
    END STATUS FROM
    (SELECT t1.*,MAX(rn) over (PARTITION BY barcode,bardate) max_val FROM
    (SELECT t1.*,row_number() over (PARTITION BY barcode,bardate ORDER BY bartime) rn FROM t1) t1) t1)
    pivot
    (MAX(bartime) FOR status IN ('INTIME' AS INTIME, 'INTROUT' AS INTROUT,'INTRIN' AS INTRIN, 'OUTTIME' AS OUTTIME))
    WHERE barcode=t2.barcode AND
    bardate = attend_date)
    
    3 rows updated.
    
    ----------------
    
    select * from t2;
    
    EMPNAME                 EMPCODE INTIME  INTRIN INTROUT OUTTIME ATTEND_DA BARCODE
    -------------------- ---------- ------- ------ ------- ------- --------- -------
    EMP_NAME1                     1 0815    1245   1215    1715    10-JAN-10 0011
    EMP_NAME2                     2 0715                   0915    10-JAN-10 0033
    EMP_NAME3                     3 0845                   1815    10-JAN-10 0022
    
    3 rows selected.
    

    HTH,
    Prazy

  • How to write the SQL without using dynamic SQL?

    How can you write this under SQL without using execute immediately?

    You can use static SQL (using something like a CASE statement)?

    test procedure (one in varchar2, b number, each number) is

    v_num_recs pls_integer;

    Start

    Select count (*)

    in v_num

    FROM table1

    where

    col1 = one and

    If b is not null then col2 = b

    If c is not null then col3 = c;

    / * i.e. If b is not null, where condition to add this line only. If c is not null, where condition should add only this line. OR condition No. it * /.

    dbms_output.put_line (v_num);

    end;

    Or should I use dynamic SQL statements for this?

    I was wondering if the two are NOT NULL? Well check this.

    Select count (*) in v_num

    table

    where col1 = one

    and col2 = (CASE WHEN (b is not null) THEN b ELSE END col2)

    and col3 = (CASE WHEN (c is not null) THEN ELSE END col3 c)

  • How to redirect to another page Using JavaScript in ADF Faces?

    Hi guys,.

    I have a case of user UI that has an af:menu which contains mutiple af:goMenuItem. When the user clicks on the menu, the menu slides down and the af: goMenuItem presents itself. As we know, you can set page destinations in af:goMenuItem to go to another page when the user has clicked, but af:menu itself cannot be redirected to another page. Well, the case of the user wants the menu itself could be redirected if the user clicks on it.

    So I think that the use of JavaScript to do this: when you click on the af: menu, redirect to another page. BUT, I've looked over the ADF Faces Javascript API and wasn't able to find this piece of code to do this. Any help?

    Another work around to the user scenario is to use the brands of HTML + CSS/JavaScript instead of af: menu and af:goMenuItem, but this changes the scope of the technology although it is not hard to do

    Any other idea to make the case of the user other than what I could think?


    Thank you guys!

    Jay

    Hello

    1. you can have a control hidden element to the navigation based on a case of control flow. In this case, you access the JavaScript command component create a new ActionEvent and he queued
    2 - JavaScript can use an af:serverListener to call a server side managed bean method to perform the navigation

    There is no JavaScript API for navigation in ADF Faces because navigation in JavaServer Faces is an event-driven framework and we do not support the developers of fight against the framework.

    Frank

  • I am a newbie to this and I was wondering how to write CSS Code for text, text color, size text and text effects...

    Please keep in mind that I am a newbie. For the moment, I don't know how to write code, so I use Muse to try to build a Web site that is not super fancy writing know, then improve or build or create a new site later. I called Adobe and they said someone in the forums may know how to write code and that he could help me. That said, if someone could answer my questions and help me somehow, I'd be really grateful.

    1. How can I write code, what code should I write to

    Text?

    Color of the text?

    Text size?

    Text/Font Style

    Text effects (such as fly in or fly out, bounce in and out bounce, spin in and spin out, fade in and fade out, etc)?

    Direction of text effect?

    Time that the effect occurs, if it is applied, initiated, comes in? example fly in or fade?

    Time than the last.

    After the effect stops, turns off? example: fly away or fade out?

    2. how to enter the code Muse?

    3. should I have a program to write the code?

    4. is there a function I could use on my computer, such as Notepad, to write the code, copy and paste it into Muse?

    5. What is the best book or books to learn how to write css, code and everything I need to do to be able to do the above and more?

    6. is there anything else I need to know or do to be able to do these things with the text?

    You can find more information on the style of your text (paragraphs, titles, etc. in some of the tutorials here: TUTORIALS |) Adobe Muse CC

    You can also check out tutorials on this page for scrolling effects that can do some of the other effects you need. Without exactly knowing your use case it's hard to give specific advice.

    Basically if it is not covered undressed under the text, scrolling Effects tutorials or in a third party widget already made, then you will need to create it yourself using CSS. You will need to use some sort of browser Firebug like developer tools in Firefox to find the ID of the element you want to add the CSS to write the CSS code and insert it into the head section of the page properties.

  • How to write the condition with the value of the parameter

    Hello
    I'm working on siebel BI publisher report. I am able to display the value of the parameter in the report.

    Now, I wanted to do something logical based on the value of the parameter.

    for example: If the user changes the value of the parameter then I have to call A submodel if user don't past not any value then it should not display A submodel

    can someone tell me how to write that above logic?

    If the parameter exists then MODEL of APPEAL one another do not call MODEL A

    Kind regards
    JAG


    Dial a submodel

  • I'm using Time Machine (1 TB), works very well, but because full starting to delete previous backups. Can I add another (LaCie 1 TB) HARD disk for backups? If so, how to proceed. Thank you!

    I'm using Time Machine (1 TB), works very well, but because full starting to delete previous backups. Can I add another (LaCie 1 TB) HARD disk for backups? If so, how to proceed. Thank you!

    You can add another drive to accept backups Time Machine... assuming it is correctly formatted for Mac to Mac OS extended (journaled), but things are not exactly "continue."

    You have not indicated if you intend to add the player to the USB port on the Time Capsule, or connect directly to your computer using USB or FireWire connections. Or the other method works, with the option to connect directly to the computer being the faster connection.

    Once the disc is added, you would go in Time Machine preferences (click the "clock" at the top of the screen on your Mac) to add the disk for Time Machine backups and delete the old Time Capsule disk, since backups will go is no longer this destination.

    Since you have a new drive, Time Machine will do a new full backup of your Mac and then go forward with incremental backups.

  • Does anyone know of a VI or how to write one that will stop the computers time be disabled if an application is run.

    Does anyone know of a VI or how to write one that will stop the computers clock be turned off if an application is run. The time and date can be reset normally while an application is running by clicking on the time in the lower right of the screen of the computer. I have an application that runs over several days and it is essential that the time and date of the computer not be changed. Is there an easy way of this lockout the user? Note that I am what I consider a beginner advanced in LV

    Thank you

    Chuck

    This isn't something that you can from LabVIEW, because this is an operating system operation, and it will depend on the operating system you are using. Under Windows, you can use Group Policy to control this. Please Google on "prevent changing the date and time of windows."

    Also, please try to refrain from stuffing your message in its entirety in the block of material. Keep short, but descriptive enough topic so we can understand what you're asking basically. Thank you.

  • How to navigate to another screen when I click on BitmapField what listener I have to use?

    Hello

    My requirement is I need to add icons to image in horizontally and when I click on the icon of the image it must navigate to specific screen, so I use BitmapField to display image icons and I added to HorizontalFieldManager but how to navigate to another screen when I click on BitmapField (the image icon) who listens to I have to use?

    Please suggest useful links.  Advanced thanks.

    Concerning

    Sunil.G

    Personally, I prefer to do the treatment that you need directly on the ground rather than using a listener.

    The following code is an example:

    BitmapField bmf = new BitmapField(Bitmap.getPredefinedBitmap(Bitmap.HOURGLASS), Field.FOCUSABLE) {
        protected boolean navigationClick(int status, int time) {
            Screen myScreen = new ();
            UiApplication.getUiApplication().pushScreen(myScreen);
            return true;
        }
    };
    
  • How to disable/enable inputtextfileld on select of another radiobutton using adf12.1.3

    Hello

    How to disable/enable inputtextfileld on select of another radiobutton using adf12.1.3

    Can anyone provide a few points on that.

    I did it like below on my listner valuechange radiobutoon method but does not work

    {} public void onRadiobuttonVCE (ValueChangeEvent valueChangeEvent)

    Add the code in the event here...

    log.info ("GCONF1001Bean onRadiobuttonVCE() started:::"+valueChangeEvent.getNewValue()); ")

    concentratorMode = valueChangeEvent.getNewValue (m:System.NET.SocketAddress.ToString ());

    concentratorMode is the value of the selected radiobutton

    RichInputText r = findComponentInRoot ("it2") (RichInputText);

    log.info ("value of r GCONF1001Bean onRadiobuttonVCE:" + r);

    {if (concentratorMode.Equals("1"))}

    log.info ("GCONF1001Bean onRadiobuttonVCE() inside the 1st if :::"); ")

    r.setDisabled (false);

    log.info ("GCONF1001Bean onRadiobuttonVCE() after 1st if :::"); ")

    }

    {if (concentratorMode.Equals("2"))}

    log.info ("GCONF1001Bean onRadiobuttonVCE() inside the 2nd if :::"); ")

    r.setDisabled (true);

    log.info ("' GCONF1001Bean onRadiobuttonVCE (after if 2nd): '");

    }

    {if (concentratorMode.Equals("3"))}

    log.info ("GCONF1001Bean onRadiobuttonVCE() inside the 3rd if :::"); ")

    r.setDisabled (true);

    log.info ("GCONF1001Bean onRadiobuttonVCE() after the 3rd if :::"); ")

    }

    }

    --

    JS

    You can set a variable bean said "textBeanDisabled" and set the value of this 'Y' or 'n', based on your health status.

    Then set the disabled property

    Just copy - paste your logic to the above post:

    String textBeanDisabled = "N";

    {} public void onRadiobuttonVCE (ValueChangeEvent valueChangeEvent)

    Add the code in the event here...

    log.info ("GCONF1001Bean onRadiobuttonVCE() started:::"+valueChangeEvent.getNewValue()); ")

    concentratorMode = valueChangeEvent.getNewValue (m:System.NET.SocketAddress.ToString ());

    concentratorMode is the value of the selected radiobutton

    RichInputText r = findComponentInRoot ("it2") (RichInputText);

    log.info ("value of r GCONF1001Bean onRadiobuttonVCE:" + r);

    {if (concentratorMode.Equals("1"))}

    log.info ("GCONF1001Bean onRadiobuttonVCE() inside the 1st if :::"); ")

    r.setDisabled (false);

    textBeanDisabled = "N";

    log.info ("GCONF1001Bean onRadiobuttonVCE() after 1st if :::"); ")

    }

    {if (concentratorMode.Equals("2"))}

    log.info ("GCONF1001Bean onRadiobuttonVCE() inside the 2nd if :::"); ")

    r.setDisabled (true);

    textBeanDisabled = 'Y ';

    log.info ("' GCONF1001Bean onRadiobuttonVCE (after if 2nd): '");

    }

    {if (concentratorMode.Equals("3"))}

    log.info ("GCONF1001Bean onRadiobuttonVCE() inside the 3rd if :::"); ")

    r.setDisabled (true);

    textBeanDisabled = 'Y ';

    log.info ("GCONF1001Bean onRadiobuttonVCE() after the 3rd if :::"); ")

    }

    }

    See you soon

    AJ

  • My iPad was stolen and exchanged by another how can I know who is using mine

    My iPad was stolen and exchanged for another how can I know who is using it?

    You can use Find iPad to see the location of the device if it is connected to the internet

    Do NOT you go after him - give the information to the authorities

    If you have an iPad that was initially not yours - you can enter - in other words - past the lock of activation?

  • Can I use Time Machine backup of my 2011 MacBook Pro (el Capitan) to set up my new (2016) MacBook Pro? How?

    Can I use Time Machine backup of my MacBook Pro 2011 (15 "/ 500 G HD/El Capitan") to set up my new (2016 13 "/ 1 TB HD) MacBook Pro? How? I want to pretty much recreate my whole installation/files.

    See this discussion of Migration Wizard. You will notice that the Time Machine is one of the sources that you can connect your new Mac to transfer what was on your old Mac that TM was back up.

  • How to recover a file deleted iCloud by using Time Machine?

    I accidentally deleted my iCloud .pages file.  I've read posts that say it can be recovered using Time Machine, but I'm not able to find the actual method to do so.  To be exact: file that contains and how to do it?

    Any help will be appreciated.

    Select ICloud Drive in the Finder, then enter the Time Machine.  Then click on the folder of Pages in iCloud drive:

    In the timeline to the right border of the window of time Machine go back until you see the document Pages.

Maybe you are looking for

  • Clicking on a mailto: link using the wrong account to send an e-mail. Is it possible to designate a default account?

    I have several accounts that I use in thunderbird. Everything works fine and I have no problem at all. But when I am on the web and click on a "mailto:" link on a Web site, Thunderbird always opens the new e-mail window using the first account in the

  • Swap DVD on Tecra M5

    I have an M5 with a DVD player that I would like to replace it with a burner. I tried one of the discs of Sony Optiarc replacement but despite Sony advising me that it is compatible, there was a difference in the rear socket which ended this approach

  • SHIFT keys, type numbers!

    7 only reason that my keyboard is now of type 7 when the left SHIFT key is used and Sands 2 with the right. 7How 7I can correct this anomaly7 7?

  • Corrupt BIOS on the Satellite X 200

    I think I've damaged the BIOS on my Satellite X 200, when I tried to update the version of the BIOS using the software on Toshiba support page athttp://UK.computers.Toshiba-Europe.com/innovation/download_bios.jsp?service=UKSatellite X 200 2.50 - WIN3

  • Windows 7 recovery disc

    Hi all I brought a new laptop (a compaq presario CQ61 401 SA) today. The laptop has windows 7 Home premium 64-bit pre-installed. I would like to change the current operation to windows 7 32-bit professional. I did the recovery disk using the compaq r