Date() function data type?

What is the data type of the Date() function return value? I tried real, integer, unsigned integer, it does not match. The function reference in TestStand Help does not describe what is the return value data type. Please help.
Thanks

Hi Jwardojo,
The return type is string
Hoe this helps !
Regards,
Mathieu Steiner, Test System Engineer, Safran Engineering
CLD, ISTQB

Similar Messages

  • Cannot create a date in cfformitem type="script"

    I tried to create date variables using "new Date" in
    cfformitem type="script" and got an error about the "new" reserver
    word. Therefore, I removed the "new" and tested the script. It
    worked with the wrong result because the todayDate and selectedDate
    in the CheckDate2 were the same. By some reason, it ignored all the
    input parameters. However, everything worked fine in the
    cfsavecontent.
    Anyone has idea? Thanks in advance.
    Here is the script:
    <cfsavecontent variable="CheckDate1">
    var todayDate = new Date(myForm.todayYear,
    myForm.todayMonth, myForm.todayDate, 0, 0, 0, 0);
    var selectedDate = new Date(
    myForm.select_date1.substr(6, 4),
    myForm.select_date1.substr(0, 2) - 1,
    myForm.select_date1.substr(3, 2),
    0, 0, 0, 0
    alert("Today's Date in the cfsavecontent:\n" + todayDate +
    "\n\n" +
    "Seleced Date in the cfsavecontent:\n" + selectedDate);
    if (selectedDate > todayDate)
    alert("You cannot select a date greater than today's date");
    else
    alert("You are ok.");
    </cfsavecontent>
    <cfform name="myForm" format="Flash">
    <cfformitem type="script">
    function CheckDate2():Void
    var todayDate = Date(myForm.todayYear, myForm.todayMonth,
    myForm.todayDate, 0, 0, 0, 0);
    var selectedDate = Date(
    myForm.select_date2.substr(6, 4),
    myForm.select_date2.substr(0, 2) - 1,
    myForm.select_date2.substr(3, 2),
    0, 0, 0, 0
    alert("Today's Date in the cfformitem:\n" + todayDate +
    "\n\n" +
    "Seleced Date in the cfformitem:\n" + selectedDate);
    if (selectedDate > todayDate)
    alert("You cannot select a date greater than today's date");
    else
    alert("You are ok.");
    </cfformitem>
    <CFCALENDAR name="select_date1" height="150" width="310"
    onchange="#CheckDate1#">
    <CFCALENDAR name="select_date2" height="150" width="310"
    onchange="CheckDate2()">
    <cfinput type="text" name="todayYear"
    value="#DateFormat(Now(), 'yyyy')#" label="todayYear">
    <cfinput type="text" name="todayMonth"
    value="#DateFormat(Now(), 'm') - 1#" label="todayMonth">
    <cfinput type="text" name="todayDate"
    value="#DateFormat(Now(), 'd')#" label="todayDate">
    </cfform>

    > I am using CF 7.0.2.
    Good. That's that sorted.
    > The problem is the cfformitem does not allow
    “new” or other reserved words
    As I'm sure you're already aware, it is so by design. For
    security reasons, the Coldfusion Flash form compiler does not allow
    the creation of objects in an event handler. It therefore prohibits
    the use of the "new" keyword in an event handler script. In fact,
    It may not even allow its occurrence in a comment!
    > When I put the function in a .as file and include it in the
    CFM file or use
    > cfsavecontent to store the as function, the CF compiler
    accepts the reserved
    > word “new” and the script works fine.
    It's a hack, one design gremlin that got away. In programming
    as in nature there are (un)lucky accidents.
    > the Date constructor ignores the input parameters and
    creates the
    > current system date in the date objects.
    We should be glad it even gets that far. Without the "new"
    keyword, it should not be possible to create a new Date object. The
    flash compiler encounters a familiar constructor pattern, and
    simply makes do by creating the default date of today, right down
    to hours, minutes and seconds. Your arguments are ignored.
    Thus, the following will all return the same result, namely,
    the date of today.
    var todayDate = Date(myForm.todayYear, myForm.todayMonth,
    myForm.todayDate, 0, 0, 0, 0);
    var todayDate = Date(myForm.todayYear, myForm.todayMonth,
    myForm.todayDate);
    var todayDate = Date(0);
    var todayDate = Date(100000000000);
    var todayDate = Date();
    Even then, the todayDate variable doesn't behave properly
    like a Date object. For example, function calls like
    todayDate.getDate() fail. Comparing dates also fails. That is
    possibly because the machine cannot cast the todayDate variable.
    However, here is an approach that does what you want.
    <cfformitem type="script">
    function CheckDate2() {
    var todayDate:Date = Date();
    var todayDateInMillis =
    Date.UTC(myForm.todayYear,myForm.todayMonth,myForm.todayDate);
    var selected_date:Date = select_date2.selectedDate;
    var selected_dateInMillis = selected_date.getTime();
    alert("Today's Date from cfformitem tag :\n" + todayDate +
    "\n\n" + "Selected Date from cfformitem tag:\n" + selected_date);
    if (selected_dateInMillis > todayDateInMillis) alert("You
    cannot select a date greater than today's date");
    else
    alert("You are ok.");
    </cfformitem>

  • Need milli seconds part in XSLT Date Function  current-dateTime()

    Hi All,
    I am calling date function, current-dateTime() in XSL. The output format is 2012-04-05T16:38:01-07:00 (Without milli seconds)
    How to get the milli seconds part...?
    Regards,
    Sudheer

    Hi Arik....
    At last i got it. :)
    Followed the below steps.
    Step1:
    Created a String variable "currentDateTimeValue" in BPEL.
    Step2:
    I have used the below code in JavaEmbedding in BPEL.
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat();
    //Date Pattern looks lil weird. But some Web service accepts only this format.
    sdf.applyPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'-00:00'");//2012-04-14T16:24:00.578-00:00
    String formattedDate = sdf.format(new java.util.Date());
    addAuditTrailEntry("Formatted datetime string is: " + formattedDate);
    setVariableData("currentDateTimeValue", formattedDate);
    Step3:
    Created a Simple XSD with an element "DateElement" of String type.
    Step4:
    Assigned "currentDateTimeValue" value to "DateElement" element, in Assign activity.
    Step5:
    Now added this DateElement in Transformation activity, as a second source variable. Mapped this data to the required target element in my XSL.
    uh-huh I got the output...
    Thanks a ton ARIK :D u r really helpful...
    Regards,
    Sudheer

  • Time and date function, how to use?

    Hello everyone,
    I want to know that how can we make use of these two system functions SY-TIMLO, SY-DATUM ?
    What should i write in data? pbo? pai?
    Should i write something like this in data?
    DATA: Ok_date TYPE SY-DATUM.
    DATA: Ok_time TYPE SY-TIMLO.
    What should i write in pbo and pai and should i need to make changes in screen elements? do i need to create one?
    Please guide and explain with an example. Thanks a lot for writing back.
    Regards,
    Lucky
    Moderator message - Please ask a specific question - post locked
    Edited by: Rob Burbank on Aug 4, 2009 12:14 PM

    Hi,
    create two variables in the top include..
    data :P_date type Sy-datum default sy-datum,
    p_time type sy-uzeit default sy-uzeit.
    Next go to screen and enter table syst...
    and select datum and uzeit and drag to screen..
    and rename the field to p_date for syst-date and p_time for syst-uzeit.
    Prabhudas

  • Dynamically built query on execution How to save the data in Object Type

    Hi,
    In pl/sql I am building and executing a query dynamically. How can I stored the output of the query in object type. I have defined the following object type and need to store the
    output of the query in it. Here is the Object Type I have
    CREATE OR REPLACE TYPE DEMO.FIRST_RECORDTYPE AS OBJECT(
    pkid NUMBER,
    pkname VARCHAR2(100);
    pkcity VARCHAR2(100);
    pkcounty VARCHAR2(100)
    CREATE OR REPLACE TYPE DEMO.FIRST_RECORDTYPETAB AS TABLE OF FIRST_RECORDTYPE;Here is the query generated at runtime and is inside a LOOP
    --I initialize my Object Type*
    data := new FIRST_RECORDTYPETAB();
    FOR some_cursor IN c_get_ids (username)
    LOOP
    x_context_count := x_context_count + 1;
    -- here I build the query dynamically and the same query generated is
    sql_query := 'SELECT pkid as pid ,pkname as pname,pkcity as pcity, pkcounty as pcounty FROM cities WHERE passed = <this value changes on every iteration of the cursor>'
    -- and now I need to execute the above query but need to store the output
    EXECUTE IMMEDIATE sql_query
    INTO *<I need to save the out put in the Type I defined>*
    END LOOP;
    How can I save the output of the dynamically built query in the Object Type. As I am looping so the type can have several records.
    Any help is appreciated.
    Thanks

    hai ,
    solution for Dynamically built query on execution How to save the data in Object Type.
    Step 1:(Object creation)
    SQL> ED
    Wrote file afiedt.buf
    1 Create Or Replace Type contract_details As Object(
    2 contract_number Varchar2(15),
    3 contrcat_branch Varchar2(15)
    4* );
    SQL> /
    Type created.
    Step 2:(table creation with object)
    SQL> Create Table contract_dtls(Id Number,contract contract_details)
    2 /
    Table created.
    Step 3:(execution Of procedure to insert the dynamic ouput into object types):
    Declare
    LV_V_SQL_QUERY Varchar2(4000);
    LV_N_CURSOR Integer;
    LV_N_EXECUTE_CURSOR Integer;
    LV_V_CONTRACT_BR Varchar2(15) := 'TNW'; -- change the branch name by making this as input parameter for a procedure or function
    OV_V_CONTRACT_NUMBER Varchar2(15);
    LV_V_CONTRACT_BRANCH Varchar2(15);
    Begin
    LV_V_SQL_QUERY := 'SELECT CONTRACT_NUMBER,CONTRACT_BRANCH FROM CC_CONTRACT_MASTER WHERE CONTRACT_BRANCH = '''||LV_V_CONTRACT_BR||'''';
    LV_N_CURSOR := Dbms_Sql.open_Cursor;
    Dbms_Sql.parse(LV_N_CURSOR,LV_V_SQL_QUERY,2);
    Dbms_Sql.define_Column(LV_N_CURSOR,1,OV_V_CONTRACT_NUMBER,15);
    Dbms_Sql.define_Column(LV_N_CURSOR,2,LV_V_CONTRACT_BRANCH,15);
    LV_N_EXECUTE_CURSOR := Dbms_Sql.Execute(LV_N_CURSOR);
    Loop
    Exit When Dbms_Sql.fetch_Rows (LV_N_CURSOR)= 0;
    Dbms_Sql.column_Value(LV_N_CURSOR,1,OV_V_CONTRACT_NUMBER);
    Dbms_Sql.column_Value(LV_N_CURSOR,2,LV_V_CONTRACT_BRANCH);
    Dbms_Output.put_Line('CONTRACT_BRANCH--'||LV_V_CONTRACT_BRANCH);
    Dbms_Output.put_Line('CONTRACT_NUMBER--'||OV_V_CONTRACT_NUMBER);
    INSERT INTO contract_dtls VALUES(1,CONTRACT_DETAILS(OV_V_CONTRACT_NUMBER,LV_V_CONTRACT_BRANCH));
    End Loop;
    Dbms_Sql.close_Cursor (LV_N_CURSOR);
    COMMIT;
    Exception
    When Others Then
    Dbms_Output.put_Line('SQLERRM--'||Sqlerrm);
    Dbms_Output.put_Line('SQLERRM--'||Sqlcode);
    End;
    step 4:check the values are inseted in the object included table
    SELECT * FROM contract_dtls;
    Regards
    C.karukkuvel

  • Exporting data clusters with type version

    Hi all,
    let's assume we are saving some ABAP data as a cluster to database using the IMPORT TO ... functionality, e.g.
    EXPORT VBAK FROM LS_VBAK VBAP FROM LT_VBAP  TO DATABASE INDX(QT) ID 'TEST'
    Some days later, the data can be imported
    IMPORT VBAK TO LS_VBAK VBAP TO LT_VBAP FROM DATABASE INDX(QT) ID 'TEST'.
    Some months or years later, however, the IMPORT may crash: Since it is the most normal thing in the world that ABAP types are extended, some new fields may have been added to the structures VBAP or VBAK in the meantime.
    The data are not lost, however: Using method CL_ABAP_EXPIMP_UTILITIES=>DBUF_IMPORT_CREATE_DATA, they can be recovered from an XSTRING. This will create data objects apt to the content of the buffer. But the component names are lost - they get auto-generated names like COMP00001, COMP00002 etc., replacing the original names MANDT, VBELN, etc.
    So a natural question is how to save the type info ( = metadata) for the extracted data together with the data themselves:
    EXPORT TYPES FROM LT_TYPES VBAK FROM LS_VBAK VBAP FROM LT_VBAP TO DATABASE INDX(QT) ID 'TEST'.
    The table LT_TYPES should contain the meta type info for all exported data. For structures, this could be a DDFIELDS-like table containing the component information. For tables, additionally the table kind, key uniqueness and key components should be saved.
    Actually, LT_TYPES should contain persistent versions of CL_ABAP_STRUCTDESCR, CL_ABAP_TABLEDESCR, etc. But it seems there is no serialization provided for the RTTI type info classes.
    (In an optimized version, the type info could be stored in a separate cluster, and being referenced by a version number only in the data cluster, for efficiency).
    In the import step, the LT_TYPES could be imported first, and then instances for these historical data types could be created as containers for the real data import (here, I am inventing a class zcl_abap_expimp_utilities):
    IMPORT TYPES TO LT_TYPES FROM DATABASE INDX(QT) ID 'TEST'.
    DATA(LO_TYPES) = ZCL_ABAP_EXPIMP_UITLITIES=>CREATE_TYPE_INFOS ( LT_TYPES ).
    assign lo_types->data_object('VBAK')->* to <LS_VBAK>.
    assign lo_types->data_object('VBAP')->* to <LT_VBAP>.
    IMPORT VBAK TO <LS_VBAK> VBAP TO <LT_VBAP> FROM DATABASE INDX(QT) ID 'TEST'.
    Now the data can be recovered with their historical types (i.e. the types they had when the export statement was performed) and processed further.
    For example, structures and table-lines could be mixed into the current versions using MOVE-CORRESPONDING, and so on.
    My question: Is there any support from the standard for this functionality: Exporting data clusters with type version?
    Regards,
    Rüdiger

    The IMPORT statement works fine if target internal table has all fields of source internal table, plus some additional fields at the end, something like append structure of vbak.
    Here is the snippet used.
    TYPES:
    BEGIN OF ty,
      a TYPE i,
    END OF ty,
    BEGIN OF ty2.
            INCLUDE TYPE ty.
    TYPES:
      b TYPE i,
    END OF ty2.
    DATA: lt1 TYPE TABLE OF ty,
          ls TYPE ty,
          lt2 TYPE TABLE OF ty2.
    ls-a = 2. APPEND ls TO lt1.
    ls-a = 4. APPEND ls TO lt1.
    EXPORT table = lt1 TO MEMORY ID 'ZTEST'.
    IMPORT table = lt2 FROM MEMORY ID 'ZTEST'.
    I guess IMPORT statement would behave fine if current VBAK has more fields than older VBAK.

  • Date Functions in Discoverer Query

    Hi,
    It has been a while since I logged into the forum. Sorry at present my contribution is only to get help. Hope to help others in future.
    Here is teh problem I am facing.
    We have frequent requirement to get the sales comparison by last year to this year
    in Week to Date, Month to Date, Year to Date timeline.
    To accomplish I use Custom Date functions in my Discoverer which results in query like below
    SELECT o100229.curr_division_code,
    SUM (DECODE (discotw_admin.fiscal_cal_by_wk.flyrweek (:fyrweek),
    o100059.fiscal_year_week, o100341.tot_lines_ext_i_s_avg_cst,
    0
    The "discotw_admin.fiscal_cal_by_wk.flyrweek (:fyrweek)" is the function I use to get the Last year week number nased on the parameter for this week number.
    But the problem with this approach is it fires the Function every time a record is read by the query which makes the query to run long time.
    Is there anyway I can use a subquery that fires the function only once and use the value of the function in the main query in Discoverer.
    I did tried to create a custom folder for the Date functions and use it in the query so that the query references the field on the cusom folder. But still I do not see any improvement in the performance.
    Thanks in advance
    Jay

    Hi Jay
    Yes, calculating like this on every row will have a drag on performance.
    Have you considered using one of the analytic functions LAG or LEAD? They are designed for this type of reporting.
    If you have considered them and rejected them can you explain why.
    Another possibility is to use a SUM analytic like this:
    SUM(Selling Price SUM)
    OVER(PARTITION BY Size,Product
    ORDER BY TO_DATE("Year",'YYYY')
    RANGE BETWEEN INTERVAL '1' YEAR PRECEDING
    AND INTERVAL '1' YEAR PRECEDING )
    The caveat here is that RANGE INTERVAL must be a YEAR and the ORDER BY must return a date!
    Does this help?
    Best wishes
    Michael

  • Decode variant data w/o using 'Variant To Data' function.

    I need to decode variant data w/o having foreknowledge of the type used to create it. That is, I'm using the 'Flattened String To Variant' function which gives me the info I need, but it's all contained within one indicator. I need some way to break this info down into its constituent elements.
    For instance, let's say I have the flattened data and type descriptor from a cluster with two elements, a boolean and a string, but not the structure itself. Passing this flattened data and/or the type descriptor into a function, I would get a 2D array (or the like) as output containing the name of the boolean (its label), its value, and the name of the string and its corresponding value.
    There must be a way to
    do this, and I suspect it's been done already, but I can't find any reference to it.
    I have attached a file named Test.vi which demostrates this problem.
    Remember, even though I know the name of the control, I won't know the type, so I cannot use the 'Variant To Data' function to deference these values. I can make ready use of DLLs, CINs, or LabVIEW code for the solution.
    Thanks ahead of time for any help! Greg
    Attachments:
    Test.vi ‏26 KB

    You might be able to take advantage of the Variant to Flattened String VI from the Advanced>>Data Manipulation>>Variants pallette. This VI converts a Variant to a flattened data string and a type descriptor. The type descriptor is explained in ap note 154. You might be able to create a VI that would parse data from the flattened data string using the type descriptor. You might have to represent each piece of data as a flattened string to work around the data flow issues in LabVIEW.

  • Overloading a DATE function with TIMESTAMP to avoid "too many declarations"

    CREATE OR REPLACE PACKAGE util
    AS
      FUNCTION yn (bool IN BOOLEAN)
        RETURN CHAR;
      FUNCTION is_same(a varchar2, b varchar2)
        RETURN BOOLEAN;
      FUNCTION is_same(a date, b date)
        RETURN BOOLEAN;
      /* Oracle's documentation says that you cannot overload subprograms
       * that have the same type family for the arguments.  But,
       * apparently timestamp and date are in different type families,
       * even though Oracle's documentation says they are in the same one.
       * If we don't create a specific overloaded function for timestamp,
       * and for timestamp with time zone, we get "too many declarations
       * of is_same match" when we try to call is_same for timestamps.
      FUNCTION is_same(a timestamp, b timestamp)
        RETURN BOOLEAN;
      FUNCTION is_same(a timestamp with time zone, b timestamp with time zone)
        RETURN BOOLEAN;
      /* These two do indeed cause problems, although there are no errors when we compile the package.  Why no errors here? */
      FUNCTION is_same(a integer, b integer) return boolean;
      FUNCTION is_same(a real, b real) return boolean;
    END util;
    CREATE OR REPLACE PACKAGE BODY util
    AS
         NAME: yn
         PURPOSE: pass in a boolean, get back a Y or N
      FUNCTION yn (bool IN BOOLEAN)
        RETURN CHAR
      IS
      BEGIN
        IF bool
        THEN
          RETURN 'Y';
        END IF;
        RETURN 'N';
      END yn;
         NAME: is_same
         PURPOSE: pass in two values, get back a boolean indicating whether they are
                  the same.  Two nulls = true with this function.
      FUNCTION is_same(a in varchar2, b in varchar2)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      FUNCTION is_same(a in date, b in date)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      FUNCTION is_same(a in timestamp, b in timestamp)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      FUNCTION is_same(a in timestamp with time zone, b in timestamp with time zone)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      /* Don't bother to fully implement these two, as they'll just cause errors at run time anyway */
      FUNCTION is_same(a integer, b integer) return boolean is begin return false; end;
      FUNCTION is_same(a real, b real) return boolean is begin return false; end;
    END util;
    declare
    d1 date := timestamp '2011-02-15 13:14:15';
    d2 date;
    t timestamp := timestamp '2011-02-15 13:14:15';
    t2 timestamp;
    a varchar2(10);
    n real := 1;
    n2 real;
    begin
    dbms_output.put_line('dates');
    dbms_output.put_line(util.yn(util.is_same(d2,d2) ));
    dbms_output.put_line(util.yn(util.is_same(d1,d2) ));
    dbms_output.put_line('timestamps'); -- why don't these throw exception?
    dbms_output.put_line(util.yn(util.is_same(t2,t2) ));
    dbms_output.put_line(util.yn(util.is_same(t,t2) ));
    dbms_output.put_line('varchars');
    dbms_output.put_line(util.yn(util.is_same(a,a)));
    dbms_output.put_line(util.yn(util.is_same(a,'a')));
    dbms_output.put_line('numbers');
    -- dbms_output.put_line(util.yn(util.is_same(n,n2))); -- this would throw an exception
    end;
    /Originally, I had just the one function with VARCHAR2 arguments. This failed to work properly because when dates were passed in, the automatic conversion to VARCHAR2 was dropping the timestamp. So, I added a 2nd function with DATE arguments. Then I started getting "too many declarations of is_same exist" error when passing TIMESTAMPs. This made no sense to me, so even though Oracle's documentation says you cannot do it, I created a 3rd version of the function, to handle TIMESTAMPS explicitly. Surprisingly, it works fine. But then I noticed it didn't work with TIMESTAMP with TIME ZONEs. Hence, the fourth version of the function. Oracle's docs say that if your arguments are of the same type family, you cannot create an overloaded function, but as the example above shows, this is very wrong.
    Lastly, just for grins, I created the two number functions, one with NUMBER, the other with REAL, and even these are allowed - they compile. But then at run time, it fails. I'm really confused.
    Here is the apparently incorrect Oracle documentation on the matter: http://docs.oracle.com/cd/B12037_01/appdev.101/b10807/08_subs.htm (see overloading subprogram names), and here are the various types and their families: http://docs.oracle.com/cd/E11882_01/appdev.112/e17126/predefined.htm.
    Edited by: hotwater on Jan 9, 2013 3:38 PM
    Edited by: hotwater on Jan 9, 2013 3:46 PM

    >
    So, I added a 2nd function with DATE arguments. Then I started getting "too many declarations of is_same exist" error when passing TIMESTAMPs. This made no sense to me
    >
    That is because when you pass a TIMESTAMP Oracle cannot determine whether to implicitly convert it to VARCHAR2 and use your first function or implicitly convert it to DATE and use your second function. Hence the 'too many declarations' exist error.
    >
    , so even though Oracle's documentation says you cannot do it, I created a 3rd version of the function, to handle TIMESTAMPS explicitly. Surprisingly, it works fine. But then I noticed it didn't work with TIMESTAMP with TIME ZONEs.
    >
    Possibly because of another 'too many declarations' error? Because now there would be THREE possible implicit conversions that could be done.
    >
    Hence, the fourth version of the function. Oracle's docs say that if your arguments are of the same type family, you cannot create an overloaded function, but as the example above shows, this is very wrong.
    >
    I think the documentation, for the 'date' family, is wrong as you suggest. For INTEGER and REAL the issue is that those are ANSI data types and are really the same Oracle datatype; they are more like 'aliases' than different datatypes.
    See the SQL Language doc
    >
    ANSI, DB2, and SQL/DS Datatypes
    SQL statements that create tables and clusters can also use ANSI datatypes and datatypes from the IBM products SQL/DS and DB2. Oracle recognizes the ANSI or IBM datatype name that differs from the Oracle Database datatype name. It converts the datatype to the equivalent Oracle datatype, records the Oracle datatype as the name of the column datatype, and stores the column data in the Oracle datatype based on the conversions shown in the tables that follow.
    INTEGER
    INT
    SMALLINT
    NUMBER(38)
    FLOAT (Note b)
    DOUBLE PRECISION (Note c)
    REAL (Note d)
    FLOAT(126)
    FLOAT(126)
    FLOAT(63)

  • Pricing date in condition type

    Hi All,
    I just wanted to know what is use of "pricing date" + '' quantity conversion" field in condition type.
    How and what is the functionality of this field.
    Thanks in advance.
    Cheers!

    > I am trying to find out what is the difference if I  am going to sellect Billing date (KOMK-FKDAT)....instead of Price date (KOMK-PRSDT).
    If you will give the date Billing date, then the value of condition type will be effective only on the billing date, and not on the Pricing date.
    For example :
    You made the sales order on date 20.06.2009  for the 10 Qtys at the rate of 10 Rs Per qty
    Did the PGI on 23.06.2009
    Invoice on 23.06.2009
    Now say for a specific condition type the record get changed on 23.06.2009 ( Like fresigh surcharge) then the new record will be effective if you have choosen the option billing date in Condition type. and if you have choosen the option of Price date than the date from the sales order pricing date will come into picture.
    Hope its clear.
    > QTY Conversion.
    >
    > Prasanth you mention ''condition bases'' ...................if you could what exactly you mean by that OR is there any other way to understand this more clearly.
    As you might be knowing in pricing procedure we give Alternative condition base value......... So if quantity conversion is ticked here then the conversion of quanity will takes place accordingly.
    Condition bases in nothing but Alternative condition base value in Pricing pricedure.
    Thanks,
    Raja

  • Function Module to Compare Date within date Range

    Hi All,
            Does anyone know Function Module to Compare Date within date Range...For example i need to find whether 08/02/2006 falls in between 07/15/2006 and 09/15/2006......

    data: datum type sy-datum value '20070802',
          datum_low type sy-datum  value '20070730',
          datum_high type sy-datum value '20070930'.
    If datum between datum_low and datum_high.
    Endif.
    Regards,
    Rich Heilman

  • Syntax for NOW() in date function

    Hi all
    What is the syntax for NOW() in Date function? Can anybody help me..
    Thanks&Regards
    Hema

    Here's how I used it.
    In VC select an expression box. When creating it, ensure you have the data type DATE selected and provide a field name. If you don't select a date data type, it will not work (the default is text).
    In the Data source field section, under the Expression field, select Formula, Under Date Functions select NOW(). You can also format the date
    If you want to select yesterdays date, use the following formula:
    DADD(NOW(),-1,'d')

  • Inverte - Date function in Update Rules

    Hi All,
    We are writing a code for converting the data into a date field using INVERTE-DATE function.
    The field GDATU in the Table TCURR needs to be converted.
    GDATU - Date As of Which the Exchange Rate Is Effective. This is not in proper format, hence we used the below code to converte in to a proper one.
    TABLES: TCURR.
    DATA: tcurr_tab TYPE TABLE OF tcurr.
    data: date_normal type sy-datum.
    FIELD-SYMBOLS
    <tcurr_wa> TYPE tcurr.
    SELECT gdatu FROM tcurr INTO corresponding fields of
    TABLE tcurr_tab.
    SORT tcurr_tab BY gdatu.
    LOOP AT tcurr_tab ASSIGNING <tcurr_wa>.
    break-point.
    CONVERT INVERTED-DATE <tcurr_wa>-gdatu
    INTO DATE date_normal.  "move that to normal date field
    write:/ date_normal.    "take a normal date field
    ENDLOOP.
    when I check for this code... it gives us the below error message
    E:Variants with INVERTED-DATE are no longer supported in the OO context.
    Use TRANSLATE ... USING '1928374664738291' instead
    Can anyone suggest me what could be done to solve this issue.
    Thanks,
    Maddy

    Hi Maddy,
    If you do F1 help for 'Inverted-Date' you will get the reason as:
    Cannot Convert Dates
    The statements CONVERT DATE and CONVERT INVERTED DATE are not allowed.
    An error message occurs in ABAP Objects if the following syntax is used:
    CONVERT DATE f1 INTO INVERTED-DATE f2.
    CONVERT INVERTED-DATE f2 INTO DATE f1.
    Correct syntax:
    CONSTANTS comp_nine(20) TYPE c VALUE '09182736455463728190'.
    f2 = f1.
    TRANSLATE f2 USING comp_nine.
    f1 = f2.
    TRANSLATE f1 USING comp_nine.
    Reason:
    Date conversions are used mainly to influence the sort sequence in in internal tables. This function can be replaced by the additions ASCENDING or DESCENDING of the statement SORT. If required, you can easily program the nines complement yourself using TRANSLATE.
    Regards,
    Saba

  • Format the date in varchar type to mm/dd/yyyy

    Hi,
    I have a column originally in date format. Later on, I changed it to nvarchar and all the existing date changed to this format "yyyy-mm-dd 00:00:00". How could I update all those dates to mm/dd/yyyy format. Should I use the expression?
    Thanks. 

    I would highly recommend you change it back to a date/time type as this is what you are storing.
    MS Sql Server has MANY ways to return dates and times formatted as you want so depending on what you want to see and how you want to see it having the data as date time is infinity better. Case in point is your current predicament.
    Sorting and filtering and comparisons on date/time types is more efficient and less error prone
    Date/time types already have built in validation, trying to enter a date of february 30 is not possible or 27 hours etc.
    You can execute date/time functions like adding a year or subtracting a month which is very useful when you start to make use of the dates/times
    Writing code against databases where dates/times are stored as strings is a horrible experience that I do not wish on anyone!
    I currently have to maintain a DB that was originally created by my predecessor with date and times everywhere as varchar and it is a nightmare, Don't Do It especially if you have the chance now to revert back!!! :)
    -Igor

  • Any Date function to find date on last friday?

    Hi all,
    Is there any date function module to find out the date on last friday....
    And one more thing....any function module to findout the range of dates for the last week...(i.e) date from last week monday to last week friday.
    Thanking u all in advance.
    Regards,
    Chandra Sekhar

    REPORT  ZSN_FRIDAYTEST                          .
    data: days type p.
    data: date type sy-datum.
    parameters: p_date like sy-datum default sy-datum.
    *-- Get the last Friday
    call function 'DAY_IN_WEEK'
      exporting
        datum         = p_date
    IMPORTING
       WOTNR         = days.
    days = days + 2.
    date = p_date - days.
    write:/ '(Assuming Monday is the first day of the week)'.
    write:/ 'Date Entered:', p_date.
    write:/ 'Last Friday:', date.
    *- Range of dates in last week
    data: date1 type sy-datum.
    data: date2 type sy-datum.
    data: days1 type p.
    data: days2 type p.
    call function 'BWSO_DATE_GET_FIRST_WEEKDAY'
      exporting
        date_in        = p_date
    IMPORTING
       DATE_OUT       = date1
    date1 = date1 - 7.
    date2 = date1 + 4.
    write:/ 'Range:', date1, '-', date2.

Maybe you are looking for