Function that check if date and time between to dates and time

hi
is there any function that can check if date and time are between to dates and time ?
thanks
Ami

You can check using IF condition.
DATA : d1 TYPE datum, d2 TYPE datum, d3 TYPE datum.
IF d1 BETWEEN d2 AND d3.
  d1 = d1 + 1.
ENDIF.
where d1, d2 and d3 are dates.
Similarly you can check for Time and Timestamp.
regards,
Jinson

Similar Messages

  • PL/SQL Function to check user name and password

    Hi,
    I am new to PL/SQL. I have a table that stores user name and password. I want to write a PL/SQL function that checks if the entered user name and password is correct, by validation against the values in the table... Can someone help me with the code? Both user name and password is varchar2

    First of all, I believe you mean a procedure that would check the application username and password. Fot, if you mean a PL/SQL procedure, that runs in the database, and that means it has to be executed after the client application is connected to the database.
    Maybe you need a procedure like this:
    procedure check_pass(p_user varchar2, p_pass varchar2) is
    pragma autonomous_transaction;
    v_passwd varchar2(200);
    begin
    select passwd into v_passwd
    from password_table
    where user_name=p_user;
    if v_passwd!=p_pass then
    update password_table set
    last_unsucc_logon=sysdate
    ,unsucc_logon_n=nvl(unsucc_logon_n,0)+1
    where user_name=p_user;
    commit;
    raise_application_error(-20101,'Invalid username/password!');
    end if;
    exception
    when no_data_found then
    raise_application_error(-20101,'Invalid username/password!');
    end;
    Study this piece of code and see if this will do.

  • I get an error when i try to execute a function that returns a date value

    Hi,
    I'm new in ODP.NET, i'm make a package that contains a function that returns a date i.e.
    Package Body General_pkg is
    Function Get_Day Return Date is
    vd_day date;
    Begin
    select sysdate into vd_day from dual;
    return vd_day;
    end Get_Day;
    End General_pkg;
    i use the next code to execute the function:
    OracleCommand cmdData = new OracleCommand("General_pkg.Get_Day", cnx);
    cmdData.CommandType = Commandtype.StoredProcedure;
    OracleParameter PRM;
    PRM = new OracleParameter();
    PRM.ParameterName = "VDATE";
    PRM.OracleDbType = OracleDbType.Date;
    PRM.Direction = ParameterDirection.ReturnValue;
    cmdData.Parameters.Add(PRM);
    try
    cmdData.ExecuteNonQuery();
    catch(OracleException e);
    When i execute this code, i have and exception, which say "identifier GENERAL_PKG.Get_Day must be declare..."
    Obviously the package is correctly created in ORACLE i tested first in sql plus and it works but in ODP.NET they don't recognize the package or the function i don't know... please help!!!

    OOOOOPSS.... i forgot that i change the user in my conecction string that's why it didn't work...
    i guess i had to much beer last night.;. :)
    thanks.

  • I need a function that will go through and encrypt all the strings

    I want to use one way enryption and need a function that will
    go through and encrypt all the strings in my password column in sql
    server 2003.
    I also need a function that compares a test password string
    is equal to the hash value in the database. Can anyone give me some
    advice in this?

    Apparently it's not as simple as I thought. My first instinct
    was
    update yourtable set password = '#hash(password)#'
    but that will crash
    This is inefficient, but you only have to do it once.
    query1
    select id, password thepassword
    from yourtable
    cfloop query="query1"
    update yourtable
    set password = '#hash(thepassword)#'
    where id = #id#

  • Function that returns the date/time ?

    We would like to make a validation in the Activity status based on the activity End Time.
    Pls... is there a function that returns something that I could compare with: "8/6/2009 01:00 PM" ?
    I know of Today but I understand that today() returns just the day (no time).
    Txs.
    Antonio

    Hi Antonio,
    You can try using the function -: Timestamp()
    To quote the CRM On Demand help files...
    "+The Timestamp function in Expression Builder returns the server date and time converted to the current user's time zone setting. For example, if the current user's time zone setting is set to Eastern Daylight Time (EDT) -0400 UTC, the Timestamp function converts the server time to EDT. The TimeStamp function performs UTC (universal time code) conversion. NOTE: Arithmetic operations (for example, add or subtract) are not supported with the Timestamp() function.+"
    Hope this helps.
    Regards,
    Cameron

  • NCo 3.02 crashes when invoking functions that return a date field

    I'm using NCo 3.02 (.NET 4 target framework) with Visual Studio 2010.
    When I invoke a function that returns date fields (like BAPI_SALESORDER_GETLIST) NCo crashes with the following message:
    SAP.Middleware.Connector.RfcTypeConversionException: Cannot convert DOCDATE....
    Below is the code I'm using:
    Dim customer_orderAPI As IRfcFunction = ecc.Repository.CreateFunction("BAPISALESORDER_GETLIST")
    customer_orderAPI.SetValue("CUSTOMER_NUMBER", "0000020000")
    customer_orderAPI.SetValue("SALES_ORGANIZATION", "ARCO")
    customer_orderAPI.SetParameterActive("MATERIAL", False)
    customer_orderAPI.SetParameterActive("DOCUMENT_DATE", False)
    customer_orderAPI.SetParameterActive("DOCUMENT_DATE_TO", False)
    customer_orderAPI.SetParameterActive("PURCHASE_ORDER", False)
    customer_orderAPI.SetParameterActive("TRANSACTION_GROUP", False)
    customer_orderAPI.SetParameterActive("PURCHASE_ORDER_NUMBER", False)
    customer_orderAPI.SetParameterActive("MATERIAL_EVG", False)
    customer_orderAPI.Invoke(_ecc)                ' >>>>  I receive the error in this line
    Dim table As IRfcTable = customer_orderAPI.GetTable("SALES_ORDERS")
    Dim returnCode As String = customer_orderAPI.GetStructure("RETURN").GetString("TYPE")
    If (returnCode.Equals("E") Or returnCode.Equals("A")) Then
    Console.WriteLine(customer_orderAPI.GetStructure("RETURN").GetString("MESSAGE"))
    Else
    Console.WriteLine("*********** SUCCESS **********")
    Console.WriteLine("Number of orders is .", table.RowCount)
    End If
    Does anyone know what is the issue and how to fix it?

    I'm using NCo 3.02 (.NET 4 target framework) with Visual Studio 2010.
    When I invoke a function that returns date fields (like BAPI_SALESORDER_GETLIST) NCo crashes with the following message:
    SAP.Middleware.Connector.RfcTypeConversionException: Cannot convert DOCDATE....
    Below is the code I'm using:
    Dim customer_orderAPI As IRfcFunction = ecc.Repository.CreateFunction("BAPISALESORDER_GETLIST")
    customer_orderAPI.SetValue("CUSTOMER_NUMBER", "0000020000")
    customer_orderAPI.SetValue("SALES_ORGANIZATION", "ARCO")
    customer_orderAPI.SetParameterActive("MATERIAL", False)
    customer_orderAPI.SetParameterActive("DOCUMENT_DATE", False)
    customer_orderAPI.SetParameterActive("DOCUMENT_DATE_TO", False)
    customer_orderAPI.SetParameterActive("PURCHASE_ORDER", False)
    customer_orderAPI.SetParameterActive("TRANSACTION_GROUP", False)
    customer_orderAPI.SetParameterActive("PURCHASE_ORDER_NUMBER", False)
    customer_orderAPI.SetParameterActive("MATERIAL_EVG", False)
    customer_orderAPI.Invoke(_ecc)                ' >>>>  I receive the error in this line
    Dim table As IRfcTable = customer_orderAPI.GetTable("SALES_ORDERS")
    Dim returnCode As String = customer_orderAPI.GetStructure("RETURN").GetString("TYPE")
    If (returnCode.Equals("E") Or returnCode.Equals("A")) Then
    Console.WriteLine(customer_orderAPI.GetStructure("RETURN").GetString("MESSAGE"))
    Else
    Console.WriteLine("*********** SUCCESS **********")
    Console.WriteLine("Number of orders is .", table.RowCount)
    End If
    Does anyone know what is the issue and how to fix it?

  • Query or function that returns distinct values and counts

    For the following table:
    ID number
    address varchar(100)
    Where the ID is the primary key and addresses might be repeated in other rows, I'd like to write a query that returns distinct addresses and the count for the number of times the address exists in the table. What's the best way to do this? Thank you in advance.

    Jlokitz,
    select address, count(*)
    from table
    group by address;
    HTH
    Ghulam

  • I'm looking for a Funciont Module that check posting date (VBRK-FKDAT)

    Hi, All
    I'm looking for a Function Module that let me know whether or not a Date (importing paramerter) is allowed for posting in period. (MARV data (including XRUEM (Allow Posting to Previous Period) ))
    If you know that, please let me know.
    Best Regards.
    Rie.

    Hi,
    Check the following FM. :
    MARV_SINGLE_READ
    Thanks & Regards,
    Faheem.

  • How do I create installer that checks the available Run Time Engine on the target system

    Hi,
    I am looking for a soultion on custom Installer where this Installer once done with the Installation should be capable of checking the presence of Runtime Engine on the target system. I amaware of including/checking the LV RTE checkbox for such options and we are working on some other concept. The thing is we would like to give the user a pop-up or any message that shows the presence of Runtime engine on the target system after finishing the installation. In case the runtime engine is not already installed on the target system, this time the message will be for the link to get the .exe and close the installation. 
    Overall we would like to minimize the size of our Installer that in case will get increased if we include Run Time Engine along with the Installer. 
    I am also assuming that such checking can be done through Advanced Tab in the Installer properties by including any such .exe for performing those things but looking for more options if possible to get it done. 
    Please do let me know if someone has any idea about it. 
    Thnaks in Advance,
    Vivek

    Hi teststand,
    you can start another program which checks if the rte is available. It should also be possible with only a batch file.
    Mike

  • User defined function to check the NULL and 0.00 value in a Amount field

    Hi Experts,
    I have one scenario in which i have amount field in Data type.
    I have to create one UDF which will do the following thing.
    1. If the amount field is Null it should throw an exception in mapping.
    2.If the amount field is 0.00 it should throw an exception in mapping.
    3. For all other cases it should pass the amount value to the target.
    Can anyone provide me the code For this UDF.
    Thanks in advance.

    Hi,
      You can add this logic to the UDF. Here var1 is the input string.
    java.math.BigDecimal b=new java.math.BigDecimal(var1);
              if(b.compareTo(new java.math.BigDecimal("0.00"))<=0)
                   //write your logic for values less equal to zero
    One small request, if you think your question has been answered, properly and correctly, could you please kindly if possible close down this thread. It helps people who look for solutions to similar problem.
    regards
    Anupam

  • My page has a button that, when clicked, calls a Java function that sets a PageLegend and changes an image but then FireFox reloads the page switching everything back to original values. What's up?

    This is happening with an ASP page. Not sure when it started, but the page used to work fine. The Java script is listed in the troubleshooting section. The button calls nextPic() which calls showPic(). After nextPic processes the page is reloaded.

    A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.
    The helpers at that forum are more knowledgeable about web development issues.
    You need to register at the mozillaZine forum site in order to post at that forum.
    See http://forums.mozillazine.org/viewforum.php?f=25

  • Feature Request: Functions to read image data, and write to tiff or jpeg.

    Functions that render image data and make it available to plugins before writing to disk would facilitate writing plugins that take rendered image data into consideration. Also, if the aforementioned image data could be subsequently written to disk possibly after a bit of modification, it would open up a whole new world for plugins.
    Plugins don't need to access the mid-rendering stages in the raw conversion / rendering pipeline, but having a shot at post-rendered, pre-written to disk image data would allow pixel manipulating export plugins to be written. A set of image file manipulation methods would be a decent work-around, providing the ability to read/write tiff/jpeg files.
    Rob

    Well, I'm replying to my own question!
    I solved the problem by reading the data from my card, then using Flatten Pixmap to create a pixmap from my data array, then using Draw Flattened Pixmap to create a picture to send to a 2D Picture.  This works fine.
    Now, how can I change the Pixmap into Image so I can save to an AVI?

  • How to replace/create the changes made in plsql function that is in package

    My problem here is that,
    There is a sql file , contains package,In that package there are more functions .I had made changes in one function body.I want it to be created with changes made in that package without effecting remaining functions.
    Here is my file
    CREATE OR REPLACE PACKAGE i2_pack_match IS
    -- Function to check whether date conditions are met or not
    FUNCTION fn_check_date(pd_sn_earliest_start_dt IN i2_sn_details.earliest_start_date%TYPE,
    pd_sn_latest_end_dt IN i2_sn_details.latest_end_date%TYPE,
    pn_sn_min_duration IN i2_sn_details.minimum_duration_weeks%TYPE,
    pd_tn_earliest_start_dt IN i2_tn_details.earliest_start_date%TYPE,
    pd_tn_latest_end_dt IN i2_tn_details.latest_end_date%TYPE,
    pn_tn_min_duration IN i2_tn_details.minimum_duration_weeks%TYPE,
    pn_date_margin IN NUMBER)
    RETURN BOOLEAN;
    FUNCTION fn_check_degree(ps_sn_degree IN i2_sn_details.degree%TYPE,
    ps_tn_degree IN i2_tn_details.degree%TYPE)
    RETURN BOOLEAN;/
    show errors
    PROMPT Creating Package Body PACK_MATCH ...
    CREATE OR REPLACE PACKAGE BODY i2_pack_match IS
    FUNCTION fn_check_date(pd_sn_earliest_start_dt IN i2_sn_details.earliest_start_date%TYPE,
    pd_sn_latest_end_dt IN i2_sn_details.latest_end_date%TYPE,
    pn_sn_min_duration IN i2_sn_details.minimum_duration_weeks%TYPE,
    pd_tn_earliest_start_dt IN i2_tn_details.earliest_start_date%TYPE,
    pd_tn_latest_end_dt IN i2_tn_details.latest_end_date%TYPE,
    pn_tn_min_duration IN i2_tn_details.minimum_duration_weeks%TYPE,
    pn_date_margin IN NUMBER)
    RETURN BOOLEAN IS
    lb_ok BOOLEAN := TRUE;
    ld_sn_latest_start_date DATE;
    ld_tn_latest_start_date DATE;
    BEGIN
    ld_sn_latest_start_date := pd_sn_latest_end_dt - (pn_sn_min_duration * 7) +
    pn_date_margin;
    ld_tn_latest_start_date := pd_tn_latest_end_dt - (pn_tn_min_duration * 7) +
    pn_date_margin;
    IF (pd_tn_earliest_start_dt > ld_sn_latest_start_date) OR
    (ld_tn_latest_start_date < pd_sn_earliest_start_dt) THEN
    --dbms_output.put_line('Date condition failed');
    lb_ok := FALSE;
    END IF;
    RETURN lb_ok;
    END;
    FUNCTION fn_check_degree(ps_sn_degree IN i2_sn_details.degree%TYPE,
    ps_tn_degree IN i2_tn_details.degree%TYPE)
    RETURN BOOLEAN IS
    lb_ok BOOLEAN := TRUE;
    BEGIN
    Vijaya-341-----Get the ALL count data equal to sum of Undergraduate,Bachelor and Masters count----------------------
    IF ps_tn_degree != -1 THEN
    IF ps_sn_degree = 75 THEN
    IF ps_tn_degree > 0 AND ps_sn_degree > 0 AND ps_tn_degree = ps_sn_degree THEN
    --dbms_output.put_line('Degree condition failed');
    lb_ok := TRUE;
    END IF;
    ELSIF ps_sn_degree = 50 THEN
    IF ps_tn_degree > 0 AND ps_sn_degree > 0 AND ps_tn_degree = ps_sn_degree THEN
    lb_ok := TRUE;
    END IF;
    ELSIF ps_sn_degree = 25 THEN
    IF ps_tn_degree > 0 AND ps_sn_degree > 0 AND ps_tn_degree = ps_sn_degree THEN
    lb_ok := TRUE;
    END IF;
    END IF;
    ELSIF (ps_tn_degree = -1) AND (ps_sn_degree = 50 OR ps_sn_degree = 25 OR ps_sn_degree = 75) THEN
    lb_ok := TRUE;
    END IF;
    Vijaya-341---------------------------------------END-------------------------
    RETURN lb_ok;
    END;
    END;
    show errors
    i made changes in function fn_check_degree.
    How can i create in oracle ?Plz any one help me.

    You need to get that revised code into the database - what you are doing with the 'alter package' command is simply recompiling what is already in the database (not your new code).
    In SQL*Plus:
    sql>@c:\myfile.sqlwhere c:\myfile.sql is the name of the file.
    Running this script will then replace the code stored in the database with the new code from your file.

  • Help to find function for month btween date

    i need a function that i bring begda and endda and give the month btween.
    like
    begda = 01012007
    endda  =  01062007
    i get 01012007,01022007,01032007.....until 01062007
    i reward
    thankes

    Hi Shnya,
    Use Transaction SU3.
    Click on tab "DEFAULTS" (Middleone)
    In the section Date Format --the very first format is DD.MM.YYYY
    Select it and save it.
    Regards,
    Dev

  • My iMessage for my Macbook Air is not working. It says no delivered with a red ! next to it. I have tried serval different options on trying to get it to work to include logging out of iCloud and checking my date and time. I have done about everythin

    My iMessage for my Macbook Air is not working. I have updated everything. My system is running on OS X Yosemite Version 10.10. When I go to send a message, it says no delivered with a next to it. I have tried serval different options on trying to get it to work to include logging out of iCloud and checking my date and time and updating FlashPlayer. I have done about everything I can think of. Any help would be greatly appreciate!

    Why start a new and very similar thread to your other one which you have not responded to (have you read the replies?)
    I suggest that no response is made to this duplicate thread. 

Maybe you are looking for