Date Format in calculations

Hi all,
we are currently upgrading our discoverer from version 3.1.25 to version 10.2.0.1.0.
we have an old report that had been created with the old version and saved on the computer (not in the database) with a date calculation on a date parameter as follows: <table_name>.<date_field> - :DATEPARAMETER (the date format of the two dates values is DD/MM/YYYY).
This calculation works fine on the old discoverer version when we run it, but when we try to run the report on the new discoverer desktop version (10.2.0.1.0) we get an error that the parameter is incorrect.
the thing is that if i convert the date format manually using the to_date function on the parameter, it works fine.
My question is what is the default date format for the calculations, and how can i set it myself?
i already added the NLS_DATE_FORMAT key in the registry under HKEY_LOCAL_MACHINE -> SOFTWARE -> ORACLE, but it doesn't work, it changes the date format of the date fields that are presented in the table after a report execution.
In addition, if we save the report to the database using the desktop version and try to run the report on discoverer plus, we get the same error and need to perform the same solution (convert the parameter manually with to_date).

mac-a-rooney wrote:
I am working with dates.
1st I want to calculate a time span for example calculate cell A2 - cell A1. In cell A1 it is written 01.01.2010 (so first of January) and in cell A2 01.02.2010 (so first of February). I wrote the dates in letters, too, to avoid misunderstandings due to different national date formats.
Since January has 31 days, the obvious result thereof is "31D". So far so good.
but now I want to multiply the 31 with a numeric value, but not the 31D, because if I do so, and let's say the numeric value is 3, then my result is 93 DAYS rather than just 93.
Are you sure you're asking in the right forum?
Using Numbers '08, with the following entries:
B2: Jan 1, 2010
C2: Feb 1,2010
D2: =C2-B2
E2: =3*D2
I get 31 (not 31D) in D2 and 93 (not 93 DAYS) in D2.
From your description, I think you're actually using Numbers '09, and Jerry's advice above applies.
Regards,
Barry

Similar Messages

  • What is the Default data format for calculations???

    When we create a calculation based on data points(dp) like :
    SUM(dp1 + dp2)
    then what Number format is applied to the calculation by default, especially the number of digits that it can show.
    Is there any rule related to that in Oracle?

    ok Guys, i finally found the answer. By default a calculation can show up to 10 digits of number with 2 decimal points & this issue has discovered a new Bug in all the versions of Discoverer. Oracle is going to create a bug on this issue soon.
    Thanks

  • Date format in Maintain capacity of iSupplier portal

    Hi,
    In Maintain capacity under planning tab of isupplier portal page, when we select a row and click on Maintain capacity,we get a detail page.In that page we r asked to specify the capacity/day for the given date range.This date field doesnot support the format dd-mon-yy/dd-mm-yy but takes date for eg 3-jul-02 but not 03-jul-02(or) 30-jul-02.
    kindly help.

    The date format is calculated using country and language settings.
    Check SAP Notes 947081 and 1164528 which deal with this topic.
    If you use an R/3 based store (UME User Management Engine) in the backend system to keep your user data please ensure that you have not only maintained the language setting but also the country setting. Both in combination determine the NetWeaver Web Dynpro locale and in consequence the calendar date format that is used, e.g. DD/MM/YYYY for Australian English and MM/DD/YYYY for USA English.
    Thanks,
    Shanti

  • Date format in ESS

    Hi Portal Gurus
    I have a requirement of changing the portal date format in ESS screens and other km documents modified date. Now it is in mm/dd/yyyy format  and should be in the dd/mm/yyyy format.
    already in  su01 user-profile date format is in dd/mm/yyyy
    Thanks
    Prasad

    The date format is calculated using country and language settings.
    Check SAP Notes 947081 and 1164528 which deal with this topic.
    If you use an R/3 based store (UME User Management Engine) in the backend system to keep your user data please ensure that you have not only maintained the language setting but also the country setting. Both in combination determine the NetWeaver Web Dynpro locale and in consequence the calendar date format that is used, e.g. DD/MM/YYYY for Australian English and MM/DD/YYYY for USA English.
    Thanks,
    Shanti

  • Receiving error when calculating two fields with different date format

    I am more familiar with SQL Server than Oracle, so after searching online without success, I am asking here.
    I'm using PL/SQL Developer with Oracle DB 11g Enterprise Release 11.2.0.2.0 64 Bit
    MyTable:
    ID_Number     VarChar2
    Date_Received     Date
    Select ID_Number,
         Date_Received,
         To_Date(substr(ID_Number, 1,6), 'YYMMDD') SentDate,    
         Date_Received - To_Date(substr(ID_Number, 1,6), 'YYMMDD') NumDays
    From MyTable
    Where substr(ID_Number, 7,3) in ('ABC', 'ABD')
    and Length(Trim(Translate((substr(ID_Number, 1,6)), '0123456789', ' ' ))) is null
    ID_Number                    Date_Received          SentDate          NumDays
    131002ABC1654106     10/16/2013               10/2/2013          14
    131004ABD8813899     4/12/2013                 4/8/2013            4
    131014ABD1844832     10/16/2013               10/14/2013          2
    Sometimes the first 6 characters in the ID_Number are not numbers, and the Length(Trim(Translate removes those records
    I just want records where NumDays > 2
    I've tried putting the query in a subquery and using Where NumDays > 2 outside.  I've also tried using the computation directly in the Where clause.  Without this in the Where clause it runs fine, with it in either spot I get the following error:
    ORA-01931: Date format picture ends before converting entire input string
    I'm not sure how to put both dates in the same format.  I've tried declaring the format to no avail.  I do not understand how I can calculate within the select but not use the same calculation within the Where clause.
    Thank you for your help.

    Hi,
    SQL is a language for describing the results you want.  How the system gets those results is up to it; you don't have much say regarding which conditions will be applied when.
    One place where you can control the order of things is in a CASE expression.  When you say
    CASE
        WHEN  condition_1
        THEN  expression_1
    END
    you can be sure that expression_1 will only be evaluated when cond_1 is TRUE.
    Try something like this:
    WITH  got_sent_date AS
        SELECT  id_number, date_received
        ,       CASE
                    WHEN  TRANSLATE ( SUBSTR (id_number, 1, 6)
                                    , 'x 0123456789'
                                    , 'x'
                                    )  IS NULL
                    THEN  TO_DATE ( SUBSTR (id_number, 1 6)
                                  , 'YYMMDD'
                END     AS sent_date
        FROM    MyTable
        WHERE   SUBSTR (id_number, 7, 3) IN ('ABC', 'ABD')
    SELECT  id_number
    ,       date_received
    ,       sent_date
    ,       date_received - sent_date    AS num_days
    FROM    got_sent_date
    WHERE   date_received  > sent_date + 2
    If you'd care to post some sample data (CREATE TABLE and INSERT statements) and the results you want from that data, then I could test this.
    Of course, you'll still have run-time errors if id_number starts with 6 digits, but they don't happen to be valid, e.g. '131100' or '130229'.  That's one of the many reasons why storing date information in VARCHAR2 columns is such a bad idea.  To get around that problem, see
    https://forums.oracle.com/message/4255051

  • List view error "Filter Value is not in a supported date format"

    I've column "Name = Order Status","Type = Calculated" & Data Type = "Date and Time". I've given this Condition in the formula:- =IF(NOT([PO Date]=0),"ORDERED","NOT ORDERED"). I'm trying to create view
    for this column but its getting error while create the view "Filter Value is not in a supported date format". 
    Same error I'm getting for column "Name = Status","Type = Calculated" & Data Type = "Number". I've given this Condition in the formula:- =IF([PO Date]="","",IF(NOT([Balance Qty]=0),"OPEN","CLOSED"))

    Can you check data type returned for your calculated column 'Balance Qty'?
    Try to set it as Number. It may help you.
    Thanks.

  • Date field difference calculation

    Hi all,
    I am new to Adobe and Java scripting so apologies if this has already been answered elsewhere - I have not been able to find it if it has.
    I want to calculate the difference between two dates fields in hours and mins on a form.
    I have two fields, both Date format (dd/mm/yyy HH:MM), a Start and End date and I want the difference between them in the Time format HH:MM.
    Can anyone help me with the script for this? What I have so far is:
    var strStart = this.getField("StartTime").value;
    var strEnd = this.getField("EndTime").value;
    if(strStart.length || strEnd.length)
    var dateStart = util.scand("dd/mm/yyyy HH:MM",strStart);
    var dateEnd = util.scand("dd/mm/yyyy HH:MM",strEnd);
    var diff = dateEnd.getTime() - dateStart.getTime();
    // One Day = (24 hours) x (60 minutes/hour) x
    // (60 seconds/minute) x (1000 milliseconds/second)
    var oneMin = 60 * 60 * 1000;
    var mins = Math.floor(diff/oneMin);
    event.value = util.printd("HH:MM",mins);
    But this is not working...
    Mary

    The result can be formatted using:
    // format result using "h:MM" format
    event.value = util.printf("%,0 0.0f" + ":" + "%,002.0f", nHours, nMinutes);
    One cannot use the date or time formats since the time values will be limited to the hours and minutes values for 1 day, so any time value that is over 23 hours 59 minutes is not possible.
    A full script solution including document level functions for conversion of date strings to minutes and converting minutes to a time string:
    // reusable document level functions;
    function Time2Num(cFormat, cDate) {
    // convert date value with format to number of minutes form Epoch date;
    var oDate = util.scand(cFormat, cDate);
    var nMins =  null;
    if(oDate ==  null) app.alert("Error converting " + cString + " using " + cForamt);
    else nMins = oDate.getTime() / (1000 * 60);
    return Math.floor(nMins);
    } // end Time2Num format
    function Num2Time(cFormat, nMins) {
    // convert number of muniutes to h:MM or HH:MM format;
    // return formatted string for valid formats;
    // return null for invalid formats;
    var cElapsed = null;
    // test for nMins being a number;
    if(isNaN(nMins)) {
    app.alert("Minutes must be number",0, 0);
    } else {
    var nHours = Math.floor(nMins / 60);
    var nMinutes = Math.floor(nMins % 60);
    switch(cFormat) {
    case "h:MM":
    cElapsed = util.printf("%,0 0.0f" + ":" + "%,002.0f", nHours, nMinutes);
    break;
    case "HH:MM":
    cElapsed = util.printf("%,002.0f" + ":" + "%,002.0f", nHours, nMinutes);
    break;
    default:
    app.alert("Invalid format " + cFormat + "\nMust be \"HH:MM\" or \"h:MM", 0, 0);
    break;
    return cElapsed;
    } // end Num2Time function
    // end document level funcitons;
    // custom calculation script;
    event.value = ''; // clear result;
    var strStart = this.getField("StartTime").value;
    var strEnd = this.getField("EndTime").value;
    if(strStart.length || strEnd.length) {
    var nDateStart = Time2Num("dd/mm/yyyy HH:MM",strStart);
    var nDateEnd = Time2Num("dd/mm/yyyy HH:MM",strEnd);
    var nMins = nDateEnd - nDateStart;
    // format result using "h:MM" format
    event.value = Num2Time("h:MM", nMins);
    // end custom calculation script;

  • How to change a date format to a calendar format

    Date Dateformat= getDateFormat();
    Calendar CalendarFormat= Calendar.getInstance();
    CalendarFormat.setTime(DateFormat);

    A Date object represents a point in time. It doesn't have anything to do with formatting.
    Calculating Java dates: Take the time to learn how to create and use dates
    Formatting a Date Using a Custom Format
    Parsing a Date Using a Custom Format

  • Date format is changing in presentation variable

    Hello,
    I have a problem with date stored in presentation variable.
    I have simple prompt with calendar field (default date value is setted from repository or session variable to current date). Selected date is stored in PP_DATE presentation variable.
    I have simple report with title to show the content of variable PP_DATE.
    And now the problem.
    When I navigate to dashboard page with this report I will get date from PP_DATE variable in some format (there is difference when I use repository or session variable). After I will push the start button I will get another date format from PP_DATE variable.
    Screenshots are stored and described in this PDF: [PDF with screenshots|https://docs.google.com/uc?export=download&id=0B2LOPOBteIShMDRmYTJlYTItNmYyZC00ODdkLWE5NjktNzI1N2RlNWMwZjBk]
    There is difference between session and repository variable. When I use repository variable I will get 'TIMESTAMP .......' from PP_DATE variable, which is the default initializer in repository variable manager. I tried to delete default initializer, but I is automatically added after saving changes.
    When is the default value of prompt setted from session variable I will get another format of date from PP_DATE variable which refers to DATE_TIME_DISPLAY_FORMAT = "yyyy-mm-dd hh:mi:ss.mss" (from NQSConfig.ini). I have changed DATE_TIME_DISPLAY_FORMAT from standard value "yyyy/mm/dd hh:mi:ss" to "yyyy-mm-dd hh:mi:ss.mss" because I am reading some data from excel, where are dates stored in MSSQL format. But this is not the reason of my problem. I have the same problem also with standard DATE_TIME_DISPLAY_FORMAT.
    The result of this strange behaviour is that I am getting errors when I am doing some calculations (for example TimeStampDiff) with PP_DATE variable. I am getting error when I am navigating to dashboard page. Everything is ok after I will push the start button.
    Do you have some tips?
    Thank you

    Kishore Guggilla wrote:
    Hey,
    you are talking about so many pieces here seems..
    first letz break down your issues list..
    1. error, this is because of default date(using repository variable) used in prompt..
    2. using presentation variables in timetampdiff functions..
    3. showing variable in title list..
    we'll go through each issue..
    because, its' messed up..I think that everywhere is the same problem. So solving issue number 1 will solve my other problems.
    "1. error, this is because of default date(using repository variable) used in prompt.. "
    I want to use date prompt with default date value (from repository or session variable) and then use pp_date presentation variable from this prompt to filter my results.
    I would like to use repos. or session variables, I dont want to write some select to fill default date value in each prompt.
    I tried to change one date in initialization block from "trunc(sysdate, 'DD')" to "to_char(sysdate, 'YYYY-MM-DD')" because it is the same format as DATE_DISPLAY_FORMAT = "yyyy-mm-dd" in NQSConfig.ini
    And now it seems to be working now.
    I can use repository var. as default date value in my prompt and use date variable pp_date to filter my results. Report return result after navigation on it and after pushing Go button.
    Can you confirm me that date format in initialization block must be the same as DATE_DISPLAY_FORMAT = "yyyy-mm-dd" in NQSConfig.ini?

  • Default date format in oracle

    Hi
    What is the default format of date in oracle?
    When I rum the following query
    select * from emp where hiredate='03-december-1981' ...
    It is returning two records.
    How is it possible?

    Kamran Agayev wrote:
    For input and output of dates, the standard Oracle date format is DD-MON-YY
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#i1847
    Although it's there in the documentation, I find it misleading, as many times, the default nls_date_format has been changed to something else, either by the dba's, or by a front end application or whatever.
    It is ALWAYS safest to use to_date and to_char when working with strings-that-you-want-as-dates or dates-that-you-want-as-strings respectively.
    Any time you store a date in the database, store it in DATE format - this gives oracle valuable information (eg. that it's a date and not just a string) which allows it to make decisions correctly when comparing them. Eg. '22/01/2009' is earlier than '14/02/2009' if the database knows it is a date, but is later if all the database sees is a string (14 being less than 22, of course).
    Anything that is already in date format, you do not need to change if you're using it in calculations (eg. select date_col_1 - date_col_2 from my_table , or sysdate) but any time you interact with the database to input a date or extract a date, you need to use to_date or to_char. (it's less important with the latter, if you don't really care how the date is displayed). Do not ever to_date() something that is already a date - you force implicit conversions of the date and that is a) pointless and b) could cause bugs in your code.
    Even the experts sometimes get caught out with dates, when they rely on implicit conversions!

  • Invalid Date format

    Hi All, My issue is that I download data to excel from a web report and then I try to use the date fields to do some calculations, but when I do so, the fomula doesn't accepts the formats. When I check the format it shows 'Text format' for these fields. Then to do the calculation I have to convert the date fields in excel to date format and then use them. Is there a way I can get the dates downloaded in date format and then I can do the calculations without doing any processing in excel. Thanks
    Puneet

    Dear Peri,
    This is a common problem, when carrying out BDC.
    For example, while recording you met with the field --> MKPF-BUDAT.
    Go to SE11 --> MKPF --> Search for BUDAT --> Double click on the Data Element i.e. BUDAT --> Double Click on the domain DATUM --> You can see under the block Output Characteristics : Output Length = 10.
    While declaring the TYPES Structure, make it CHAR(10).
    Consider this technique as the Rule-of-Thumb while doing BDC.
    Regards,
    Abir
    Don't forget to award points *
    Regards,
    Abir
    Don't forget to award Points *

  • Custom Date format in InfoPath DatePicker without code

    Hello,
    I am trying to customize the date format in my date picker on my InfoPath form. I went to the date picker properties and was able to change it so that it displays the format in "14-Mar-01" but I want to really customize and have it formatted to look
    like the following "MMM-YY" format. Is there a way to go about setting this format without custom code? I am unable to use any server side code for my forms.
    Thank you!

    Hi,
    According to your post, my understanding is that you want to customize the date format like “MMM-YY” without custom code.
    The date format which is set in InfoPath Form is different from the date column’s default format in SharePoint.
    In SharePoint, the default format of the date column is depended on the selection of the “Time Zone”, “Region”, “Calendar” options in the “Regional Settings” of Site Settings.
    However, the date format which is set in InfoPath Form only works on the items’ NewForm, EditForm, DispForm in the lists.
    I recommend that you can create a calculated column based on the date column with this formula: =TEXT(Date,"MMM-YY").
    Then, you can modify view to display the calculated column and hide the date column in the list.
    The result is shown as below:
    Thanks,
    Yumi Fu
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]

  • Date format in invoice for

    hi,
    us company code is billing to uk customer and the date format in the oy01 tcode is maintained for uk country as dd.mm.yyyy and for us it s maintained as mm/dd/yyyy now the requirement is if us company code is billing irrespective of the customer, date format for due date(which is calculated by adding the no. of days in the payment terms ) in the invoice should be mm/dd/yyyy but here it is appearing as dd.mm.yyyy as customer belong to uk is there any standard setting where in this requirement can be met, i have also checked date format in su01 for the user id it is not effecting the out come.
    kindly guide.
    thanks

    hi shakeer,
    execute SU01 goto DEFAULTS - there date format will be there.
    please change as per your requriment.
    hope this clears your issue
    balajia

  • Date format in the RPD

    Hi gurus,
    In the rpd, I have a condition where
    If (received_date- current_date) < X then ....
    the received date in the database is numeric. Ex : 20040810
    How do I change the date format to match the default current date in the expression builder.
    Thanks
    Avinash

    Looks like you are using this calculations based on fact table or might be physical columns.
    I would suggest to use logical columns so that you can use the date(for received_date) column your day dim.
    or else
    map the day dim to fact table and use physical expression for the same, its same as your other post with status=completed as I said in my last email.
    You have to use timestampdiff function.
    If helps mark
    Edited by: Srini VEERAVALLI on Feb 20, 2013 2:47 PM

  • Urgent: Date format conversion

    Hi
    I need to convert the date from 08/31/2006 to 31-Aug-06 format.
    Plz help me out.  Useful answers will be rewarded.  Thanks in advance.

    Hello,
    Check the table :
    T247
    Check these fm's
    Function Modules related to Date and Time Calculations
    DATE_COMPUTE_DAY  : Returns weekday for a date
    DATE_GET_WEEK  : Returns week for a date
    DAY_ATTRIBUTES_GET  : Returns attributes for a range of dates specified
    MONTHS_BETWEEN_TWO_DATES  : To get the number of months between the two dates.
    END_OF_MONTH_DETERMINE_2  : Determines the End of a Month.
    HR_HK_DIFF_BT_2_DATES  : Find the difference between two dates in years, months and days.
    FIMA_DAYS_AND_MONTHS_AND_YEARS  : Find the difference between two dates in years, months and days.
    MONTH_NAMES_GET  : Get the names of the month
    WEEK_GET_FIRST_DAY  : Get the first day of the week
    HRGPBS_HESA_DATE_FORMAT  : Format the date in dd/mm/yyyy format
    SD_CALC_DURATION_FROM_DATETIME  : Find the difference between two date/time and report the difference in hours
    L_MC_TIME_DIFFERENCE  : Find the time difference between two date/time
    HR_99S_INTERVAL_BETWEEN_DATES  : Difference between two dates in days, weeks, months
    LAST_DAY_OF_MONTHS  : Returns the last day of the month
    Vasanth

Maybe you are looking for

  • Wifi problems on my MacBook Pro

    I recently bought a MacBook Pro and I've noticed that there seems to be a problem with the web browser/intermet connection... I turn on my Mac and the internet works fine, it's fast and loads everything but then the web pages won't load and the blur

  • SRSS 4.2 readMessage::socket looping limited exceeded

    I have 1 user out of 45 Sun Rays that keeps getting rebooted. The Sun Ray session terminates, the /var/opt/SUNWut/log/messages says: sunray-servers utauthd: [ID XXXXXX user.info] Worker1 NOTICE: readMessage::socket looping limit exceeded. Close it. T

  • Peoplesoft convert Oracle non-unicode database to unicode database

    I am following doc 1437384.1 to convert a Peoplesoft database from non-unicode database to unicode database I use the following export statement (as user PS) SET NO TRACE; SET OUTPUT output_file.dat; SET NO DATA; EXPORT *; And the following import st

  • Query for Vendor

    Hi All, I'm a new user of SAP B1 Please help me generate query for unpaid vendor by due date. Below is the query that I did. But I want to modify and will only display unpaid vendor. Thanks.. SELECT T2.[CardCode], T2.[CardName], T0.[TransId], T0.[Due

  • JSP in custom tag attributes...

    Sirs,           A very nice feature from a development perspective, would be the ability           to use JSP code within custom tags. Say I have a page on which I wish           to give all the information on a widget. Say further that I have