Calculated Date Column Returns 30 December 1899

Hi!
This might be a bug in SharePoint... I wanted to have the Created column without the time, but since that doesn't seem possible I created a calculated column called Date Created which returns a Date only (ie- no time) and the formula is simply "=Created".
This should work right? Well it does and it doesn't. After a while I noticed some of the values had become 30.12.1899. If I edit the calculated column under list settings without making any changes but just clicking OK, all the values are updatet and correct, but adding new items to the list sets the Date Created value back to 30.12.1899.
Weird... I'm using Norwegian locale on this server so that might have something to do with it. The only thing I can think about is that the Date Created calculation is being done before the value of Created is set so that in effect this is a date null-value... Anybody else had a problem with this?

Hi,
I have the same issue when using the modified date column in a calculated field. What i try to do is to create a field that shows only the modified date (e.g. not the time).
When I try to create a calculated field with =modified, set the data type to date and time and check 'date only' format my calculated field returns 30/12/1899.
When i type out the formula =DATE(YEAR(Modified),MONTH(Modified),DAY(Modified)) it returns 30/12/3799.
Regards and thank you for the (any) response.

Similar Messages

  • Oracle 8i DATE column returned wrong with 9i thin driver

    I have an Oracle 8i database with a column named "timestamp" with the following column metadata:
    DATA_TYPE=93
    TYPE_NAME=DATE
    I execute the following statement:
    select "timestamp" from oracle_data_log
    When I look at the result set metadata using the Oracle 9i drivers, I get (as expected):
    getColumnType=93
    getColumnTypeName=DATE
    getColumnClassName=java.sql.Timestamp
    When I look at the result set metadata using the Oracle 9i drivers, I get:
    getColumnType=91
    getColumnTypeName=DATE
    getColumnClassName=java.sql.Timestamp
    That column type 91 indicates it is SQL type DATE which is for date only values (no time information).
    Our code (working against many different databases with many different drivers) works off the column type metadata and messes up. (Obviously I can look at the column class name string as well / instead, but I'd like the column type to come back with the proper SQL type.)
    As I said, it works as expected with the 8i thin driver (and the DataDirect JDBC driver).

    Thanks for the info.
    It seems to me that returning a SQL type DATE (which means it only stores date information) for an Oracle DATE type (which stores date and time information) is the wrong thing to do. The Oracle DATE type stores date and time information which corresponds to the SQL TIMESTAMP type. It should return TIMESTAMP as the SQL type.
    It seems like it would confuse a client application into thinking there is no time information available, which there is.
    A friend suggested that since a SELECT on a DATE value only displays the date portion and not the time portion, that might be why they did it, but that still doesn't sound right. The Oracle DATE type stores date and time which corresponds to the SQL TIMESTAMP type.
    I guess they might have done it to distinguish between Oracle DATE and TIMESTAMP types, but I still don't like it...
    I wonder if there is any documentation on why Oracle made the decision?

  • Workflow email reminders on calculated date column - Paused

    I am having an issue in trying to setup a SP designer workflow to be able to send a notification if an approval is not met by a certain date. I was hoping someone could point out where I am going wrong with the
    workflow details below?
    The workflow is based off an infopath form. The form when submitted sends an email to the appropriate person that an action is required (which works fine). I
    have created a calculated column (Reminder-2A) which is [Created]+20. So the approver has 20 days to approve the form. The workflow is required to send a notification to the user if the form has not been approved.
    I have tried to use the "Start on item change" workflow context & paused the workflow until the ReminderDate is greater than or equal today. There are 2 steps for this approval so I have 2 approval steps based off the FormStatus when the approval
    takes place.
    So the issue stems from the first step not getting released from its pause state. I was hoping that once the form is approved the FormStatus field would force the workflow to complete that step (unpause) and move to the next step but how I have it currently,
    it does not work that way. Can someone point me in the right direction as how I go about achieving this?
    I have attached a snippet of the 2 stage approval and the workflow state on the SharePoint site
    Many thanks

    Hi Luca,
    I think you can use event handler associated with item for item changed. Every time an item has been edited, check whether a workflow instance is still running. If so, cancel the running workflow. This link would help you. http://chrissyblanco.blogspot.com/2007/08/cancelling-running-workflow.html
    If you don't want to go for coding, you can try below approach, SP designer workflows have this behavior that they do not stop when the item is updated.
    Create 2 lists (parent and child) and a workflow on each (wf1 and wf2) respectively. When your condition meets in the workflow(wf1) of parent list, create an item in child list on which the wf2 workflow starts and pauses till the specified date. Once the
    pause is completed, you can send the mail from workflow 1 or 2 and then delete the item in child list.
    Modify your Parent list workflow to handle the below scenario. If you ever update the item in parent list, delete the corresponding item in child list that was paused/waiting and create a fresh one.
    You need to store the fields Parent list Item ID, version(optional).
    Parent list is your actual list. Child list is a staging one which you never expose to anyone.
    Thanks Sandy

  • Date Column Defaulting to 12:00 AM When It Shouldn't

    I have a column called 'Archive Date'. All it is is a date field with a timestamp in the format dd/mon/yy HH:MI AM. When I added the table with this Archive Date column to my business area it looks fine. If I look at a list of values in today's date range, I see: (17-Nov-09 10:15 AM), (17-Nov-09 10:18 AM) and (17-Nov-09 10:23 AM). All still looks fine.
    But, when I create a report, the Archive Date column for all records from November 17th looks like this: (17-Nov-09 12:00 AM). Regardless of whether the list of values shows it should be 10:15, 10:18 or 10:23, they all show 17-Nov-09 *12:00 AM* in the report. It makes me think the report can't see the 3 distinct times and it's just plugging in 12:00 AM because it doesn't see a value. But, why would that be if the business area can see all 3 distinct times? Discoverer can even see the 3 times when I'm editing the workbook. It sees 17-Nov-09 10:15, 10:18 and 10:23 when I'm looking at the list of values from Edit Worksheet. But, when the report is run, it only shows 12:00 AM (which isn't even an option).
    Any ideas as to what's going on with this date column?
    Thanks!

    That didn't work either. I'm still getting the wrong timestamp.
    But, I did try something else, with more unexpected results. Just for the heck of it, I exported my workbook to excel (the workbook showing the 12:00 AM timestamps). When I opened the Excel file, it has the Archive Date with the correct times. Very strange. I export the workbook with all 17-NOV-09 12:00 AM timestamps in every Archive Date row, and in Excel it opens with the correct dates (17-NOV-09 10:15, 10:18 and 10:23 AM). So weird.
    That seems to reinforce that Discoverer can at least see the dates as they exist in the data warehouse, but for some reason, it insists on displaying 12:00 AM. And exporting the 12:00 AM results to Excel actually produces the correct times. Is this like some Java bug or something? I seem to get bit by Java problems more often than not.
    ***EDIT***
    I shouldn't say your suggestion didn't work entirely. It worked in that I am no longer getting 17-NOV-09 12:00 AM. But, it's returning a timestamp that does not exist for the given record. For example, all 3 Nov 17th timestamps (in the Discoverer report) are now showing 17-NOV-09 10:11 AM. 10:11 AM isn't even a timestamp available in the database for any record in the table. Why did it arbitrarily pick 10:11? It seems like your suggestion to create a TO_CHAR calculation from the column is on the right track, but the 10:11 AM thing is odd.
    Edited by: user527082 on Nov 17, 2009 4:29 PM

  • How to get Week,Month and Year details from a date column

    Hi frenz,
    I've a column like tran_date which is a date column..... I need the next week details based on this column and so on...
    I need month and year details as well based on this tran_date column.... can any one tell me how...
    Thanks in advance

    My example for objects:
    create or replace type date_object as object
      centure number,
      year    number,
      month   number,
      day     number,
      hour    number,
      minute  number,
      second  number,
      daypart number,
      week    number,
      constructor function date_object(p_dt date)
        return SELF as result
    create or replace type body date_object is
      constructor function date_object(p_dt date)
        return SELF as result
      as
      begin
        SELF.centure:= trunc(to_char(p_dt,'YYYY')/100);
        SELF.year:=    to_char(p_dt,'YYYY');
        SELF.month:=   to_char(p_dt,'MM');
        SELF.day:=     to_char(p_dt,'DD');
        SELF.hour:=    to_char(p_dt,'HH24');
        SELF.minute:=  to_char(p_dt,'MI');
        SELF.second:=  to_char(p_dt,'SS');
        SELF.daypart:= p_dt-trunc(p_dt,'DD');
        SELF.week:=    to_char(p_dt,'IW');
        return;
      end;
    end;
    select date_object(sysdate),
           date_object(sysdate).year
    from dual;Regards,
    Sayan M.

  • Date Column not getting sorted in a table in web Dynpro Java

    Hi All,
    I am facing an issue while sorting the date column in a table in my web dynpro java application.
    When the date is displayed in the sql format in tha table, I am able to sort the date column successfully but when we convert the date field from sql format to util format in our table and then sort it does not work.
    Kindly let us know the steps to be followed in this case to sort the date column of a table in Simple Date format as we do not want date in the sql format to be displayed.
    Thanks & Regards,
    Anurag

    Hi,
    You might want to check whether both your browser's language settings are identical. The browser language could also determine the date format.
    As a workaround, you could add an extra attribute to your context, and set the calculated property to 'true'.
    In your table, add a new column and bind to this new attribute, and hide your original date column
    If you sort using the date column that's hidden now, you could use the calculated field to fixed-format your date the way you prefer (by using the SimpleDateFormatter class for instance)
    Cheers,
    Robin

  • Using MODEL clause and COUNT for not numeric data columns....

    Hi ,
    Is it possible somehow to use the COUNT function to transform a non-numeric data column to a numeric data value (a counter) and be used in a MODEL clause....????
    For example , i tried the following in the emp table of SCOTT dataschema with no desired result...
    SQL> select deptno , empno , hiredate from emp;
    DEPTNO EMPNO HIREDATE
        20  7369 18/12/1980
        30  7499 20/02/1981
        30  7521 22/02/1981
        20  7566 02/04/1981
        30  7654 28/09/1981
        30  7698 01/05/1981
        10  7782 09/06/1981
        20  7788 18/04/1987
        10  7839 17/11/1981
        30  7844 08/09/1981
        20  7876 21/05/1987
        30  7900 03/12/1981
        20  7902 03/12/1981
        10  7934 23/01/1982
    14 rows selected Now , i want to use the MODEL clause in order to 'predict' the number of employees who were going to be hired in the 1990 per deptno...
    So , i have constructed the following query which , as expected, does not return the desired results....
    SQL>   select deptno , month , year , count_
      2    from
      3    (
      4    select deptno , to_number(to_char(hiredate,'mm')) month ,
      5                to_number(to_char(hiredate , 'rrrr')) year , count(ename) count_
      6    from emp
      7    group by  deptno , to_number(to_char(hiredate,'mm'))  ,
      8                to_number(to_char(hiredate , 'rrrr'))
      9    )
    10    model
    11    partition by(deptno)
    12    dimension by (month , year)
    13    measures (count_ )
    14    (
    15     count_[1,1990]=count_[1,1982]+count_[11,1982]
    16    )
    17  /
        DEPTNO      MONTH       YEAR     COUNT_
            30          5       1981          1
            30         12       1981          1
            30          2       1981          2
            30          9       1981          2
            30          1       1990
            20          4       1987          1
            20          5       1987          1
            20          4       1981          1
            20         12       1981          1
            20         12       1980          1
            20          1       1990
            10          6       1981          1
            10         11       1981          1
            10          1       1982          1
            10          1       1990 As you see , the measures for the 1990 year is null...because the measure(the count(deptno)) is computed via the group by and not by the MODEL clause...
    How should i transform the above query... so as the "count_[1,1982]+count_[11,1982]" will return non-null results per deptno...????
    Thanks , a lot
    Simon

    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    SQL>
    SQL> SELECT department_id, MONTH, YEAR, count_
      2    FROM (SELECT e.department_id
      3                ,to_number(to_char(e.hire_date, 'mm')) MONTH
      4                ,to_number(to_char(e.hire_date, 'rrrr')) YEAR
      5                ,COUNT(e.first_name) count_
      6            FROM employees e
      7            WHERE e.department_id = 20
      8           GROUP BY e.department_id
      9                   ,to_number(to_char(e.hire_date, 'mm'))
    10                   ,to_number(to_char(e.hire_date, 'rrrr')));
    DEPARTMENT_ID      MONTH       YEAR     COUNT_
               20          8       1997          1
               20          2       1996          1
    SQL> --
    SQL> SELECT department_id, MONTH, YEAR, count_
      2    FROM (SELECT e.department_id
      3                ,to_number(to_char(e.hire_date, 'mm')) MONTH
      4                ,to_number(to_char(e.hire_date, 'rrrr')) YEAR
      5                ,COUNT(e.first_name) count_
      6            FROM employees e
      7            WHERE e.department_id = 20
      8           GROUP BY e.department_id
      9                   ,to_number(to_char(e.hire_date, 'mm'))
    10                   ,to_number(to_char(e.hire_date, 'rrrr')))
    11  model
    12  PARTITION BY(department_id)
    13  dimension BY(MONTH, YEAR)
    14  measures(count_)(
    15    count_ [1, 1990] = count_ [2, 1996] + count_ [8, 1997]
    16  );
    DEPARTMENT_ID      MONTH       YEAR     COUNT_
               20          8       1997          1
               20          2       1996          1
               20          1       1990          2
    SQL> ---
    SQL> SELECT department_id, MONTH, YEAR, count_
      2    FROM (SELECT e.department_id
      3                ,to_number(to_char(e.hire_date, 'mm')) MONTH
      4                ,to_number(to_char(e.hire_date, 'rrrr')) YEAR
      5                ,COUNT(e.first_name) count_
      6            FROM employees e
      7           GROUP BY e.department_id
      8                   ,to_number(to_char(e.hire_date, 'mm'))
      9                   ,to_number(to_char(e.hire_date, 'rrrr')))
    10  model ignore nav
    11  PARTITION BY(department_id)
    12  dimension BY(MONTH, YEAR)
    13  measures(count_)(
    14    count_ [1, 1990] = count_ [2, 1996] + count_ [8, 1997]
    15  );
    DEPARTMENT_ID      MONTH       YEAR     COUNT_
              100          8       1994          2
               30         12       1997          1
              100          3       1998          1
               30          7       1997          1
                           5       1999          1
               30         12       1994          1
               30         11       1998          1
               30          5       1995          1
              100          9       1997          2
              100         12       1999          1
               30          8       1999          1
                           1       1990          0
               30          1       1990          0
              100          1       1990          0
               90          9       1989          1
               20          8       1997          1
               70          6       1994          1
    93 rows selected
    SQL>

  • XML Publisher - Dynamic Data Columns Issue

    Hi,
    I am creating a amortization report where I need to show the amortization schedule for unearned revenue. Customers have signed different years of contract and I need to show the amount as per their remaining contract months. So if there are 2 month remaining in the contract then I should show the data for 2 months only and if there are 10 months then I should display 10 months. If we run the report for both customers then it should display two lines in report. For first customer the data should be only for 2 months and for second row(customer) there should be data for next 10 months. These months should be columns in the report(like excel columns, not rows). I need to display all months in columns instead of rows.
    I have acheived that using Dynamic Data Columns as mentioned in the user guide. Everything is working fine except following issues -
    1. How to create page level total?_
    I have created page total in my template using <?add-page-total:TOTUREV;'UREV'?> and displaying using <?show-page-total:TOTUREV?> but when I run the report in excel format these page total do not display. These columns are static columns not dynamic.
    If I run the report in pdf format then the static column total is displayed correctly.
    2. When I run the report in excel format then report run fine and it shows all the columns properly but if I run the report in pdf format then the dynamic column are not displayed in their own columns, all the columns are overwriting each other in a single columns itself, its not expanding.
    3. How do I get the total for the dynamic columns?_
    I need to display the page level total for the dynamic columns also, how do I do that?
    4. When I run the report in excel format the 2 decimal places of the numbers are gone(it works fine in pdf output), like 12.50 becomes 12.5 and 14.00 becomes 14. I need to maintain those 2 decimal places. I have tried using <fo:bidi-override direction="ltr" unicode-bidi="bidi-override"><?format-number:CVALUE;'999999D99'?></fo:bidi-override> but this does not solve my problem completely. It shows the values correctly in excel but then I am not able to do any calculation on those columns, looks like it converts them to text values.
    Any help is really appreicated. Please let me know if you need the xml template and data file.
    Regards
    Hitesh

    Hi Hitesh,
    Can you please upload your RTF and XML template file? I will try to spend sometime on this issue.
    Cheers
    Sachin

  • How to display a percentage sign in calculated member column?

    Hello all,
    in my report I have a calculated member column whose value is determined by follwing value formula:
      if CurrentColumnIndex - 2 = 1 then 
            If GridValueAt(CurrentRowIndex, CurrentColumnIndex-3, CurrentSummaryIndex) = 0 then 
            0 
            else 
            (GridValueAt(CurrentRowIndex, CurrentColumnIndex-1, CurrentSummaryIndex)/ 
            GridValueAt(CurrentRowIndex, CurrentColumnIndex-3, CurrentSummaryIndex)) * 100 
        else 
            If GridValueAt(CurrentRowIndex, CurrentColumnIndex-5, CurrentSummaryIndex) = 0 then 
            0 
            else 
            (GridValueAt(CurrentRowIndex, CurrentColumnIndex-1, CurrentSummaryIndex)/ 
            GridValueAt(CurrentRowIndex, CurrentColumnIndex-5, CurrentSummaryIndex))*100 
    Returned is a numeric value and it is being correctly displayed in calculated member column. As the value should represent percentage, I need to display a % sign after every value.
    How would I achieve this? I have seen a thread here in the discussion where approach with a formula and DisplayString function is mentioned - but there are no details how this could be achieved....
    The crosstab in question looks like this:
    Calculated Member is based on "REV_TOTAL" group column.
    I also attached the .rpt file (renamed to .txt for upload)
    Many thanks in advance,
    Marin

    Hello Raghavendra,
    thanks for the quick reply.
    Unfortunately it is not as easy at it seems - calculated member column is not showing in report designer and I can not apply the suggested approach with formatting toolbar...
    The column only shows here (right click on table ->  "Advanced Calculations" -> "Calculated Member...") and there is no possibility to format it directly:
    Any other suggestions?
    Many thanks,
    Marin

  • How do I select a date column and display the millesecond along with it.

    I am trying to select a date column from database and want to
    display millesecond with it. How do I do this. I am aware of
    the "alter session set NLS_DATE_FORMAT = 'MM/DD/YY HH:MI:SS'"
    command. However, I do not know how to display this with the
    millesecond.
    Thanks for all the help.

    Example:
    SQL> CREATE OR REPLACE JAVA SOURCE
      2  NAMED "MyTimestamp"
      3  AS
      4  import java.lang.String;
      5  import java.sql.Timestamp;
      6 
      7  public class MyTimestamp
      8  {
      9  public static String getTimestamp()
    10   {
    11   return (new
    12   Timestamp(System.currentTimeMillis())).toString();
    13   }
    14   };
    15  /
    Java created.
    SQL> CREATE OR REPLACE FUNCTION my_timestamp
      2    RETURN VARCHAR2
      3  AS LANGUAGE JAVA
      4  NAME 'MyTimestamp.getTimestamp() return java.lang.String';
      5  /
    Function created.
    SQL> CREATE TABLE test_time
      2    (date_col VARCHAR2 (23))
      3  /
    Table created.
    SQL> INSERT INTO test_time (date_col)
      2  SELECT my_timestamp
      3  FROM   dual
      4  /
    1 row created.
    SQL> SELECT date_col
      2  FROM   test_time
      3  /
    DATE_COL
    2001-11-02 14:58:51.766

  • SUB Totals within a Dynamic Data Column

    Has anyone ever calculated SUB Totals in a Layout with a Dynamic Data Column?
        The TOTAL for all data is expressed on the Data Column tab of the Layout as C(1):C(1) - 0FISCPER / Posting Period is the Dynamic Characteristic.  When the system actually displays the 12 columns of data for the Year, the formula for TOTAL is also adjusted - no problem here.  But the user also wants SUB Totals, by Quarter, within the Year.
        Any insight or suggections are appreciated !
    Thanks,
    Lyle

    Hello,
    use variables Q1, ..., Q4 for the quarters and create
    data colums as follows
    1 Q1 dynamic = X
    2 Total C(1)
    3 Q2 dynamic = X
    4 Total C(3)
    5 Q3 dynamic = X
    6 Total C(5)
    7 Q4 dynamic = X
    8 Total C(7)
    9 Year Total C(2)C(4)C(6)+C(8)
    Regards,
    Gregor

  • How to validate date columns in tabular forms?

    Hi,
    I have two date columns in a tabular form
    1.Start_date 2.End_date so here i need to validate the end_date as should not be lesser value than start_date column
    so any solution for this?

    Hi,
    use a validation of type "Function returning boolean" and the following code:
    IF to_date(:YOUR_END_DATE,'YYYY-MM-DD') < to_date(:YOUR_START_DATE,'YYYY-MM-DD') THEN RETURN FALSE;
    ELSE RETURN TRUE;
    END IF;The date format is of course in your choice.
    Hope this helps...
    Thanks
    Sandro

  • SQL Developer Database Copy truncates DATE columns

    Hope someone can help me. I want to copy all object from one schema to another schema in my Database. I have used the "tools - Database Copy" utility and it copies all of the objects and data however when I query the DATE columns in the destination schema the time element has been truncated? Why has this happened?
    tab_h contains a column h_date of type DATE
    Query
    SELECT TO_CHAR(H_DATE, 'MM-DD-YYYY HH24:MI:SS') from tab_h;
    returns
    02-07-2012 09:54:14
    from the source table
    yet returns
    02-07-2012 00:00:00
    from destination schema? This is the case for all DATE columns in the tables.
    I noticed this was happening in 3.0.04.34 and I upgraded to 3.1.07.42 and it still happens.
    Thank you

    Maybe there's a problem getting the OS settings right; try to add this to \sqldeveloper\bin\sqldeveloper.conf:
    AddVMOption -Duser.region=USIf that works, you can try others closer to you.
    Hope that helps,
    K.

  • Performance question for date column

    Hi All,
    I have a select query which joins two tables with more than 20 million records each based on a where condition of year = 2006. Would creating an function based index on the date column help improve the performance. Please suggest any other alternatives. The query is supposed to return about 10 million records which is taking about 10 hrs right now. How can I improve the performance.
    Thanks

    Rob, Here is the explain plan. Any suggestions based on this information. Please refer me to any information on how to interpret this information. Thanks
    | Id  | Operation            |  Name                      | Rows  | Bytes |TempSpc| Cost  | Pstart| Pstop |
    |   0 | SELECT STATEMENT     |                            |   101K|    10M|       |   173K|       |       |
    |   1 |  HASH JOIN           |                            |   101K|    10M|  3088K|   173K|       |       |
    |   2 |   PARTITION RANGE ALL|                            |       |       |       |       |     1 |     9 |
    |   3 |    TABLE ACCESS FULL | Table A                    |   101K|  1888K|       | 87464 |     1 |     9 |
    |   4 |   PARTITION RANGE ALL|                            |       |       |       |       |     1 |     9 |
    |   5 |    TABLE ACCESS FULL | Table B                    |   156K|    13M|       | 85454 |     1 |     9 |

  • Calculated Percentage Columns in Pivot Table loose formating in Excel

    I have a simple report built using pivot table ( OBIEE 11.1.1.5.0)
    1 Metric and 1 dimension using pivot table. and I duplicated the metric column and change it to % column.(Show data as % of column). SO far so good. Below is the snapshot
    http://tinypic.com/r/2s14xa9/7
    Now i download the report in excel and all the % values are messed up . Below is how it looks
    http://tinypic.com/r/bede90/7
    I tried messing with data formats etc..nothing works.. I cannot add a custom column format to the metric column since it will impact the derived % column.
    Is this a bug ?Any pointers ..
    Thanks

    Hi,
    Follow up this SR:
    SR 3-5060435331: Calculated Percentage Columns in Pivot Table loose formating in Excel
    Workaround: (not sure may be give a try)
    also give a try like below one then try to download it may work.
    In that % column -->add the below statement in the Custom CSS section of the column properties:
    mso-number-format:"\@"
    Refer snapshot here:
    http://i53.tinypic.com/a09kqv.jpg
    This will treat the data in the column as text while downloading to excel, hence retaining any leading or trailing spaces.
    Thanks
    Deva

Maybe you are looking for