How to write an if else logical expression for this condition

Hai All

I wrote some other logic if for my condition

If the weather is betweeb 0145 and 0630 and timeout is a column in a table is null that updated sysdate-1
If the time is bet0645 and 0900 then timein is null then insert into timein in a table named dail_att
and time bet 1130 and 1300 then if barcode null then insert timein else update timeout
and bet 1645 and1730 then if null of barcodes and timein null then insert timein or update expiration time

It comes to my condition to generate presences. Ive tried a logic and pls tell executed case faster than logical ifelse
and give me a soluton



This is my encoding

If: bartime between 0145 and 0630 and: 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-1;
otherwise if: bartime between 0645 and 0900 and: bar code is null then
insert into dail_att (barcode, timein, attend_date)
values(:Barcode,:Bartime,:bardate);

otherwise if: bartime between 1145 and 1300 and: bar code is null then
insert into dail_att (barcode, timein, attend_date)
values(:Barcode,:Bartime,:bardate);
on the other
Update dail_att
the value of timeout =: bartime
where = barcode: barcode
and ATTEND_DATE =: BARDATE;
end if;
otherwise if: bartime between 1645 and 1730 and: bar code is null then
insert into dail_att (barcode, timein, attend_date)
values(:Barcode,:Bartime,:bardate);
on the other
Update dail_att
the value of timeout =: bartime
where = barcode: barcode
and ATTEND_DATE =: BARDATE;
end if;
Another thing: bartime > 1730 and: bar code is null then
Update dail_att
the value of timeout =: bartime
where = barcode: barcode
and ATTEND_DATE =: BARDATE;
end if;
WHEN THE OUTPUT: SYSTEM. LAST_RECORD = "TRUE" OR: BAR CODE IS NULL;
NEXT_RECORD;
forms_ddl ('commit');
end loop;



Concerning

Srikkanth.M

1 your code has bugs... the word "else if" should be elsif

and in what format you store time?

Tags: Database

Similar Questions

  • Owner OF THE LICENSE No. [removed-kglad], PREVIOUSLY INSTALLED on OLD PC WHO CRASHED. HOW AND WHERE TO FIND THE NEW DOWNLOAD FOR THIS NEW PC. LICENSE FROM A USER OF MAY 2011.

    Owner OF THE LICENSE No. [removed-kglad], PREVIOUSLY INSTALLED on OLD PC WHO CRASHED. HOW AND WHERE TO FIND THE NEW DOWNLOAD FOR THIS NEW PC. LICENSE FROM A USER OF MAY 2011.

    Available downloadable Setup files:

    Download and installation help links Adobe

    Help download and installation to Prodesigntools links can be found on the most linked pages.  They are essential; especially steps 1, 2 and 3.  If you click on a link that does not have these listed steps, open a second window by using the link to Lightroom 3 to see these "important Instructions".

  • How to write data from the INI file for the control of the ring

    Hai,

    I need to write the data read from the INI file to a control of the RING. Doing this operation using variants I get the error.

    I will be happy if someone help me. I have attached the file special INI and VI.


  • How to write a SQL for this condition?

    I have a table with columns v_sub, v_visit, and T_DATE and the structure is like this

    v_sub v_visit T_DATE
    1 visit-1 01 - mar - 09
    1 visit-2 05 - mar - 09
    1 visit-3 17 - mar - 09
    2-visit-1-4 February 09
    2 visit-2 12 - mar - 09
    2 visit-3 20 - mar - 09

    I want to write a query that control weather it is in chronological order or not. (for v_sub, v_visit and T_DATE must be in chronological order as above)

    and I want to check the condition as below:

    v_sub v_visit T_DATE
    1 visit-1 01 - mar - 09
    1 visit-2 5 February 09
    1 visit-3 17 - mar - 09
    2-visit-1-4 February 09
    2 visit-2 12 January 09
    2 visit-3 20 - mar - 09


    Thanks in advance

    Use the LAG function to get previous date

    SQL> -- sample data
    SQL> with t
      2  as
      3  (
      4     select 1 v_sub, 'visit-1' v_visit, to_date('01-mar-09','dd-mon-yy') v_date from dual union all
      5     select 1, 'visit-2', to_date('05-mar-09','dd-mon-yy') from dual union all
      6     select 1, 'visit-3', to_date('17-mar-09','dd-mon-yy') from dual union all
      7     select 2, 'visit-1', to_date('04-feb-09','dd-mon-yy') from dual union all
      8     select 2, 'visit-2', to_date('12-mar-09','dd-mon-yy') from dual union all
      9     select 2, 'visit-3', to_date('20-mar-09','dd-mon-yy') from dual
     10  )
     11  -- end of sample data
     12  select v_sub, v_visit, v_date, lag(v_date) over(partition by v_sub order by v_visit, v_date) v_previous_date
     13    from t
     14  /
    
         V_SUB V_VISIT V_DATE    V_PREVIOU
    ---------- ------- --------- ---------
             1 visit-1 01-MAR-09
             1 visit-2 05-MAR-09 01-MAR-09
             1 visit-3 17-MAR-09 05-MAR-09
             2 visit-1 04-FEB-09
             2 visit-2 12-MAR-09 04-FEB-09
             2 visit-3 20-MAR-09 12-MAR-09
    
    6 rows selected.
    

    Now you can check if the previous_date is less than T_DATE

  • How can I fix the problem "the drivers for this device are not installed?

    I tried to connect my Xbox 360 to PC and it worked then when I looked for pc on my xbox it has disappeared. So I went back to my PC and tried the problem and is it says there was a problem installing the drivers for it, also my xbox connected only to windows media center... How can I fix it?

    Hello

    We can refer to this article and check if that helps.

    Connect your console to Xbox LIVE using a Windows PC instead of a router: http://support.xbox.com/en-US/xbox-live/connecting/win-computer

    Thank you.

  • How can I find the number of Gz for this computer?

    Please tell me where to learn the Gz on this computer a Dell Inspriron I560 2010

    Click Start or press the Windows key and when the start menu opens, made a click computer on the right and select Propertieslaw. Your nickname of CPU processor and speed must be in the middle of the right in the System group.

  • No matter what a description on how to use the editor of text used for this Forum?

    I am very frustrated trying to use the text editing functions (without the use of HTML code, I don't have them) that can be used to create messages in this Forum.

    Can someone point me to a good description of the text editor used to enter/edit the messages in this Forum? Thank you very much in advance.

    You may be more likely to get a response if you asked it question in the comments of the http://forums.adobe.com/community/general/forum_comments Forum

  • How to get the total number of records for this query

    SELECT SSN, FIRST, MID, LAST, UCX_UCFE, TRAPOSS, DUAPOSS, CLAIM_SEQ, CLAIM_DT, MAX (INSERT_DT) INSERT_DT.
    CLAIM_STAT, ISSUE_CDE, AGENT_ID FROM (SELECT A.SSN, A.FIRST A.MID, A.LAST, B.UCX_UCFE, B.TRAPOSS, B.DUAPOSS,
    C.CLAIM_SEQ, C.CLAIM_DT, C.INSERT_DT, C.CLAIM_STAT, C.ISSUE_CDE,
    RN C.AGENT_ID, ROWNUM
    THE APPLICANT HAS, CLMTELIG B, UICLAIMS C
    WHERE A.CLMT_SEQ = B.CLMT_SEQ AND B.CLMT_SEQ = C.CLMT_SEQ AND TRUNC (C.INSERT_DT) BETWEEN 1 JANUARY 09 ' AND 5 JANUARY 09')
    GROUP OF NSS, BEGINNING, MIDDLE, LAST, UCX_UCFE, TRAPOSS, DUAPOSS, CLAIM_SEQ, CLAIM_DT, CLAIM_STAT, ISSUE_CDE, AGENT_ID



    Thank you all in advance for watching in my post.

    Select count (*)
    Of
    (.. .your question here...) ;

  • How to write Save function based on the drop-down list box selection data in app mxml flex4 with as3

    Hi all

    I'm working on the application web flex4 with as3.

    I have a doubt, I've created a mxml it has two text boxes, except the button and a combo box that is has two option as a percentage and the amount.

    my needs are I gave here.

    need 1: when I choose option amount that two text boxes does not have to be editable.when I select text tat box two percentage option will be editable.

    need 2: when I select the percentage in combox option and two text boxes are empty, and then click the button Save-> I want to display warning msg

    need 3: when I select the option amount combox and the two boxes are emptu click the button Save-> I don't want any warning messages.

    How to validate it and how to write backup for this function.

    This is my sample code:

    list box ID = baseAmtPer

    ID TextBox1 = maxCommAmt.text

    ID = baseAmtPer.text text box

    If (((baseAmtPer.editable!=true) & & (maxCommAmt.editable! = true)) & & ((baseAmtPer.text=="") & &(ma xCommAmt.text=="")) |) (baseAmtPer.text == "") | (maxCommAmt.Text=="")) -> This condition not allowing while I'm selecing amount in combo box. How the TWO TEXT BOX WILL BE EMPTY for this problem

    {

    Alert.Show ("enter in all areas", "Information");

    }

    on the other

    {

    some encodings

    }

    Hello

    Please go through the following Code:

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" minHeight >

    Import mx.collections.ArrayCollection;

    Import mx.controls.Alert;

    Import spark.events.IndexChangeEvent;

    protected function button1_clickHandler(event:MouseEvent):void

    {

    If (comboBox.selectedItem == "Percentage" & textBox1.text == "" & textBox2.text == "") {}

    Alert.Show ("enter the values");

    }

    }

    protected function comboBox_changeHandler(event:IndexChangeEvent):void

    {

    {if(ComboBox.SelectedItem=="Amount")}

    textBox1.editable = false;

    textBox2.editable = false;

    }

    else {if(comboBox.selectedItem=="Percentage")

    textBox1.editable = true;

    textBox2.editable = true;

    }

    }

    ]]>

    Amount

    Percentage

    Thank you and best regards,

    ------------------------------------------------------------------------------------------ --

    Vibhuti Gosavi . [email protected] | www.infocepts.com

    ------------------------------------------------------------------------------------------ --

  • Regular expression for the format: 000-000 - 000000 000000

    Hi guys,.

    I need to validate the columns in a regular expression for the format of 000 000 - 000000 000000.

    For example - if the column contains a value such as "500 110 - 500044 000100" then it should return 'true' otherwise 'false. '

    Your timely help is well appreciated.

    Thanks in advance.

    Hello

    inDiscover wrote:

    Hi guys,.

    I need to validate the columns in a regular expression for the format of 000 000 - 000000 000000.

    For example - if the column contains a value such as "500 110 - 500044 000100" then it should return 'true' otherwise 'false. '

    Your timely help is well appreciated.

    Thanks in advance.

    If you want a regular expression

    REGEXP_LIKE (str

    {{' ^ {\d{3} \d{3}-\d{6} \d{6}$'

    )

    According to your needs.

    You don't need regular expressions for this.  It will be more efficient to use

    TRANSLATE (str

    '012345678'

    '999999999'

    ) = 999 999 - 999999 999999'

  • How to write expressions/rules/SQL workflow

    Hi all.

    We are recent users of CRM onDemand, we would write a few workflow rules, but can't seem to find all the information on how to do it. The help section is limited in the responses, and some of the issues here are not as specific in what we do.

    Someone has any advice on books, websites, etc. on where to find the knowledge we need on how to write workflow rules and the use of SQL and expressions in CRM on Demand?

    Thanks in advance!

    For your first case:
    1. you cannot create a workflow in r15 for activity but you can in R16

    Create new to create a workflow
    Name: Auto email send
    registration type: activity
    trigger: when the new record
    rules: put your rules by clicking the fx icon IE this is where you enter the rule by saying that the owner is different from the person who creates the activity or the delegate field is filled (another way of seeing things)
    then save the workflow

    In the section actions
    Choose the action 'create e-mail notifications '.
    In the: Section choose "Registration of the user on Relative" and "owner of the activity.

    Save it. Make sure that the activity and workflow are marked active.

    2. in the second scenario:
    How do you create an account and to automatically fill in the name of the sales of the sale - don't know
    But you can create a fill of opportunity and self with the name of the owner of the account using this validation in the field (you need not the workflow), you can use the FieldValueJoin function.

    Hope this helps - btb there's no book you can go thro the help and you will find some directions

  • How to write the function for bottom of logic...

    I have a picture in the picture I have a records like below
    code value
    1 20
    2 null
    3 30
    4 null
    5 40
    6 null


    The output need to have the values displayed in the fields first, followed by the NULL values as below

    code value
    1 20
    2 30
    3 40
    4 null
    5 null
    6 null

    I think the suspicion is that the values must be concatenated with the replacement of NULL values with (;).
    as
    20, 30, 40
    Get single values and insert into the table...

    for this I don't know how to write function for who can please help me on these...

    Published by: Claudia on June 22, 2011 22:45

    Published by: Claudia on June 22, 2011 22:51

    Create or replace function test_fun
    is
    cursor fun1 is the value select from table by CSA 2;-"this select query will return 20,30,40, null, null, null".
    v_out varchar2 (20);
    Start
    fun1 open cursor;
    loop
    extract the fun1 in v_out;
    dbms_output.put_line (v_out); - this is the command display output on the screen.
    output when fun1 not found %;
    end loop;
    close;
    end;

    Please try it and tell us if no query...

    Thank you
    IQ

  • 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?

  • How to write to the system event log

    Windows 7 Home Premium 64-bit Service Pack 1

    I run a daily work to create an image of my drive system hard. Repeatedly the work began and, due to a material error, be abandoned. In some cases (mostly), this will result in the image of yesterday being destroyed, leaving me with no viable image in case I need to restore. Although the reader is old enough (3 years), I'm not want to replace it, because I know no other activity that has had a problem with it and diagnoses reported no problem.

    So I want to execute a batch file or a script before the regular daily system backup operation. The script would go to a SMART short self-test, and if no errors are reported, would signal the backup task to run. Conversely, if the self-test report any error, the script don't trigger not the backup task to run. I think I will need to write an entry in a kind of system event log, which would be defined in the trigger condition in the entrance to the Windows Task Scheduler for the backup task. If anyone can help with the details of how to write an entry to a log of system events?

    Or, perhaps, there is better way to achieve what I want to do?

    I guess that there is not a very high probability that the script will always truly detect a problem and prevent the last image of the destruction. But I tell myself that it is worth the effort.

    TIA

    Assuming that smartctl generates an errorlevel nonzero in case it failed, the following script will work, as long as Smartctl is run under the same account as Casper.

    I also made your script more transparent control setting. The if/then/else/if/then embedded instructions are perfect for computers, but are often misconstructed by the human mind. I'm a big believer in the KISS principle.

    OFF @echo
    FOR %%d Ko (% Date %) Today SET = %% A

    SET now = time %
    echo =.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.
    ECHO% now %%d now %%d %2
    echo"=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.
    Si (« %3 « == » »
    echo of the provided insufficient parameters
    output/b 1
    )

    IF/i %1 is goto short Action
    IF/i %1 is goto long Action
    ECHO 1 Parm [%1] is INVALID
    output/b 1

    : Action
    smartctl t %1 %2
    the echo of SECONDS to WAIT for selftest %3
    choice/n/t %3/d N
    smartctl-l selftest %2%

    Set Flag="%temp%\Smartctl.log".
    If exist % del % % flag flag
    If %ERRORLEVEL% is 0 echo. > Flag %

    For the handshake to work, you must place the CASPER command inside a file of commands as follows:

    off @echo

    If exist c:\Casper\Casper.exe '% temp%\Smartctl.log '.

  • How to write a program that allows an HTTPs connection to the APACHE TOMCAT server in blackberry JDE

    Hello.. I am very new to the blackberry JDE environment. But then, I have a project in which I should write a program that will make an HTTPs connection to the apache tomcat server using blackberry JDE. The simulator which I use is 8330-JDE.

    Here is my code...

    import java.io.IOException;

    Import java.io.InputStream;

    Import javax.microedition.io.Connector;

    Import javax.microedition.io.HttpsConnection;

    Import net.rim.device.api.ui.UiApplication;

    Import net.rim.device.api.ui.container.MainScreen;

    public class Httproto extends UiApplication

    {

    public public static void main (String [] args)

    {

    Httproto instance = new Httproto();

    instance.enterEventDispatcher ();

    }

    public Httproto()

    {

    pushScreen (new HttpsConnectionScreen());

    }

    }

    final class HttpsConnectionScreen extends screen

    {

    public HttpsConnectionScreen()

    {

    HttpsConnection c = null;

    InputStream is = null;

    int rc;

    try {String url =

    "https://192.168.2.3: 8443/cit/j_acegi_security_check? j_username = sanogo & j_password = redhat;

    c = (HttpsConnection) Connector.open (url);

    c.setRequestMethod (HttpsConnection.POST);

    System.out.println ("connection is open with the server");

    Get the response code is open the connection,

    Send the request and read HTTP response headers.

    The headers are stored until asked.

    RC = c.getResponseCode ();

    System.out.println ("response from the server" + rc);

    if (rc! = HttpsConnection.HTTP_OK) {

    throw new IOException ("HTTP response code:" + rc);

    }

    is = c.openInputStream ();

    Get the ContentType

    The string of type = c.getType ();

    The length and process data

    int len = (int) c.getLength ();

    if (len > 0) {

    int actual = 0;

    int BytesRead = 0;

    byte data = new byte[len]; while ((bytesread! = len) & (real! = - 1)) {

    real = is.read (data, bytesread, len - bytesread);

    bytesRead += real;

    }

    } else {}

    int ch;

    while ((ch = is.read (())! = - 1). {

    }

    }

    } catch (ClassCastException e) { throw new IllegalArgumentException ("not a HTTP URL");}

    }

    catch (IOException ioe) {}

    finally {

    Try

    {

    if (is! = null)

    is. Close();

    if (c! = null)

    c.Close ();

    }

    catch (IOException ioe) {}

    }

    }

    }

    When I run this program in the Simulator, I can do nothing. Please correct me if I'm wrong in coding.

    As I am new to this blackberry JDE environment, ideas and suggestions on how to write and run the sample applications in the blackberry are more welcomed.

    Concerning

    Hinduja

    Make sure that your MDS starts when the Simulator starts.  In the JDE will in Edition > Preferences > Simulator > General and click the checkbox "launch Mobile Data System connection with Simulator Service.

Maybe you are looking for

  • Satellite L30-PSL33E - product recovery fails

    Laptop Satellite / L30-psl33E This is what happens:... Product recovery disc boots, loading files, windows recovery watch utility box select English, then gives possibility of partition of drive or any use, I click to recommended any disc, then compu

  • indicator does not illuminate

    B: we expect the signal to buy. C. we collect data from channel 1 D. collect US data from channel 3 and turn the led ready trigger. The problem is the expectation of 50 ms in A. Without this expectation, the trigger won't light.

  • 0x800f081f on SP2 error code install

    I have Vista Home Premium 32-bit with SP1 is installed on a Toshiba Satellite L350. I discovered that Windows Update has been tried and do not install SP2 since August 2009.  I tried: Download and install the update manually. turn off all other appli

  • Problem installing Vista SP2 FastCGI

    I'm trying to install php using FastCGI. When I go to the mappings Manager-> Add Module Mapping, in the dropdown Module I don't see FastCGIModule.

  • No connection with Aironet 1602i on only web gui

    Can someone tell me if there is no magic required to get the standalone Aironet 1602i (AIR-SAP-1602I-E-K9) react on its web interface?  The device appears when connected to the Netgear M4100 switch - 26G - PoE (), flashing green LED, then I think "ch