Convert this number to a date

Hi, from my database there is a field for date and it is a number like this: 1295944970.   This corresponds to a date displayed as 1/25/2011 displayed on the website.   Does anybody know how to convert the data 1295944970 from the database date field to the actual date of 1/25/2011?   thanks in advance for any help.
Steve

The number you are trying to convert to a date is a Unix timestamp and it counts the number of seconds since 1/1/1970
So to convert that into a date in Crystal you use the following formula:
dateadd ("s",1295944970-18000, #1/1/1970#)

Similar Messages

  • Convert this number (2454664,29112) to Date and Time.

    Hi,
    I want to convert this number (2454664,29112) to Date and Time.
    I wrote the query :
    select to_date(2454664,'J')+ numtodsinterval(29112,'second') from dual
    It give the results 16/07/2008 08:05:12
    but the correct results is 15/07/2008 08:05:12
    Is it correct?
    Please help me.

    Don't know whether the result is correct or not, but has select to_char(sysdate,'J') from dual to do anything with it?
    Regards
    Etbin
    to be more specific
    select to_char(now,'J') || ',' || to_char(now,'sssss') the_number
      from (select sysdate now from dual)Message was edited by:
    Etbin

  • Converting a number to a date

    I am getting data in from an outside source table as a number ex: 200807 which stands for July 2008.
    I need to move the data from the source table to another table and have it be a date.
    So 200807 will end up as 07/01/2008 in the final table.
    Any assistance is welcome.
    Thanks

    Use to_date:
    SQL> select to_date('200807','YYYYMM') from dual;
    TO_DATE('200807','YY
    01-JUL-2008 00:00:00

  • Converting seconds value to a date

    Hi,
    I have date column as integer like 1212638737.Could anyone tell me the way of converting this value to corresponding date value?

    user11365275 wrote:
    I have date column as integer like 1212638737.Could anyone tell me the way of converting this value to corresponding date value?How is the number to be converted to a date? Its not a Julain date because the number is way too big

  • Converting Oracle 7-Byte Internal Date FOrmat to MM/DD/YYYY format.

    I can get the date stored in the database in 7-Byte Internal representation.
    I want to convert this number to mm/dd/yyyy format,using PRO*C-SQLDA(Method 4),overriding any NLS DATE Format.
    null

    Only Oracle Spatial questions
    here please.
    null

  • How can I convert a number field in a to Date?

    I have two columns in a table, and i would like to concate this two fiels to read Januaray-2010
    CREATE TABLE "CATDB"."SC_DTL_MEASURE_DETAIL"
               "TIME_YEAR"                 NUMBER(*,0),
               "TIME_INCREMENT"            NUMBER(*,0),
       )Time_Incriment data need to be changed to month MON Januaray to December
    1
    2
    3
    etc
    12
    Time_year data is
    2010
    2010
    etc

    Well one way easiy way without changing your column datatypes (this would be the best way) is to first convert the numbers into text. Then concat this text. Then convert the text into a date value. Then print the date value as you want it to appear.
    example
    with testdata as (select 2010 TIME_YEAR, 1 TIME_INCREMENT from dual union all
                      select 2010 TIME_YEAR, 12 TIME_INCREMENT from dual)
    select time_year, time_increment,
           to_char(to_date('01-'||to_char(TIME_INCREMENT,'FM00')||'-'||to_char(TIME_YEAR,'FM0000'),'DD-MM-YYYY') ,'FMMonth-YYYY')
    from testdata;
    2010     1     January-2010
    2010     12     December-2010

  • Convert a number value to a date

    Post Author: Jeremiah
    CA Forum: Formula
    I'm using Crystal Reports XI. I'm coming across a problem trying to convert a
    number value to a date.  I'm using formula below: if not isnull({qryStoreCheckIn.CHECKINDATE})  or {qryStoreCheckIn.CHECKINDATE}="0"the(stringvar MyDate:= ToText({StoreCheckIn.CHECKINDATE},0,"");cdate(2000 + val(left(MyDate,1)),val(mid(MyDate,2,2)),val(right(MyDate,2))))  
    For this line, I'm receiving an error msg of that "A month number must be between 1 and 12
    Here are some of the field's data examples
    70608
    70501
    0
    61231 Would anybody have any ideas on how to solve this?

    Post Author: SKodidine
    CA Forum: Formula
    You are getting the error "A month number must be between 1 and 12" because you are trying to convert 0 to a date.  The third data item in your field data.
    I suggest you default the date to some date when it is zero or eliminate 0 as a date from your formula such as:
    if not isnull({qryStoreCheckIn.CHECKINDATE})
    then(stringvar MyDate:= ToText({StoreCheckIn.CHECKINDATE},0,"")
    else
    If {qryStoreCheckIn.CHECKINDATE} = 0 then (stringvar MyDate:= "00101");  // If date is zero then it is set to 2000/01/01
    After this, you will not have problems with a zero date.

  • Essbase 9.3 Calc scripts. Pb with dates. How to convert (string = number) ?

    Hello,
    I've a problem with Essbase(Planning?) Scripts on version 9.3. It looks simple but I do not find any (clean) solution :
    On my Essbase database, I have a member called "Reference_Date" on my axis Indicators. It is a date data type, that is to say, it displays a number corresponding to a YYYYMMDD format. For example : 20091029 for October 29th 2009.
    In calc scripts I often need to compare the month included in that "Reference_Date" with the current Member of my Time Axis (I have 12 Months members based on the format M02 for February for example). The final aim is to calculate a number of complete years since that "Reference_Date".
    But theses two elements are not of the same "type" (one is a number value and the other is a "member" in Time Axis). So I'm forced to convert one of this two elements in order to compare it.
    For example I can extract the month value of the "Reference_Date"' and put an "M" before it to have a Time member equivalent or I can convert the member Name M10 to a number (10))
    in both cases I have the same type problem : I don't know how to convert a string into a number nor how to convert a number into a string.
    (For example @CONCATENATE doesn't work with numbers). and that my only remaining problem.
    I didn't find any Essbase Function which do this (conversion number <=>string).
    Is anyone have an Idea ?
    Thanks for your help
    Best regards

    I don't know any way for you to compare your data against your metadata. Not directly. To me it makes little enough sense to try that I'm not surprised the developers didn't provide for it.
    I've converted member names to strings, manipulated the strings (calc script functions are not good at this), and turned them back into member names, but that's really the only use I've had for string manipulation. I don't think an equivalency operator even exists for string data. And I see no way to begin thinking of a member name, once converted to a string, as a number.
    It makes even less sense to me to try thinking of a data value as a string. Even text values in Sys 11 are stored as numbers. Not encoded characters, but just a number to look up somewhere.
    I think you can do what you want though, with something like this...
    IF (@ISMBR("FY08"))
    vYr = 2008;
    ELSEIF (@ISMBR("FY09"))
    vYr = 2009;
    ENDIF;
    IF (@ISMBR("M01"))
    vMth = 1;
    ELSEIF (@ISMBR("M02"))
    vMth = = 2;
    ENDIF;
    "Years_Since_Reference" = ((vYr * 100) + Mth) - ("Reference_Date" / 12);
    Obviously, the math will need some work, coz that doesn't actually work, but the logic above essentially turns your metadata into numbers, which is what you are after.
    Good luck,
    -- Joe

  • Convert Number to the date format

    Hello,
    In CRM, i want to input the number as a parameter and convert the number into Date format. Is there any function module in CRM which accepts the number and gives the date as output .
    Example.
    suppose input given is 734484
    output : 12-12-2011  .
    The number  734484 reflects  the total number of days from '0000' to 12-12-2011
    Regards,
    Rohini

    920575 wrote:
    I have a sql like this:
    select to_date('MAR','Mon', 'NLS_DATE_LANGUAGE=American') m from dualI want to display '3' instead of showing MAR...
    I tried to use to_char(date,'MM') but the result will return '03'.
    I would like to have the output exactly equal to 3.3 (without single-quotes) is a NUMBER. It is exactly equal to the NUMBER 03.
    '3' is a string. It is not equalt to the string '03'.
    Do you want a NUMBER or a string?
    If you want the 1-character string '3', then use 'fmMM' instead of 'MM'.
    select  TO_CHAR ( to_date ('MAR', 'Mon', 'NLS_DATE_LANGUAGE=American')
                    , 'FMMM'
                    )   AS m
    from    dualTO_CHAR sometimes adds padding (sometimes spaces, sometimes '0's) to make elements a constant width. For example, some months need 2 characters for the 'MM' format, so TO_CHAR, by default, left-pads with '0's to make all months 2 characters, whether they need 2 characters or not. Using 'FM' (case insensitive) IN the format string changes whether or not this kind of padding will be added.
    You could also use LTRIM to remove the leading '0's in this case, but why remove them when it's easier not to generate them in the first place?

  • Hi want to convert a number in crore, e.g. 10000000 to 1.00 Can anybody help on this?

    Hi All,
    I want to convert a number in crore format.
    My basic problem is, I am using a custome format:
    #,##0.00,,,%;
    Here main task is done by ,,,%.
    Each comma (,) is dividing a number by 1000. Thus three commas are dividing a number by 10^9 digits.
    But I need number in crore (i.e. 10^7), Thus we have used this percent sign (%).
    Here I can get required Value but appended percent (%) to it. I can temporary hide this using wrap text.
    But I need exact solution to convert a number in crore.
    Can anybody help me regarding the same.

    Hi Neha,
    You can use EPMScaleData function, in that give scaling factor as per your requirement.
    For more details you can go through following link
    How to use EPMScaleData in a fully dynamic report
    Regards,
    Shrikant

  • How can i convert this data(00000000) into date format(yyyy-MM-dd)

    Hi,
    i am using this method to convert date format from string.
    public static string FormatDate(string inputDate, string inputFormat)
                System.DateTime date = DateTime.ParseExact(inputDate, inputFormat, null);
                string datepresent = DateTime.Now.Date.ToString("yyyy-MM-dd");
                return datepresent;
    its working properly,
    but when input data is like 00000000 i am getting error this is not valid.
    how can i convert this into date format any help..!

    Have you tried the above code:
    I can see it is working with both Date and DateTime destination nodes.
    Map:
    Functoid Parameters:
    Functoid Script:
    public static string FormatDate(string inputDate, string inputFormat)
    string datepresent;
    if (inputDate == "00000000")
    datepresent = "0000-00-00";
    else
    System.DateTime date = DateTime.ParseExact(inputDate, inputFormat, null);
    datepresent = date.ToString("yyyy-MM-dd");
    return datepresent;
    Input:
    <ns0:InputDateString xmlns:ns0="http://DateFormat.SourceSchema">
    <DateString>00000000</DateString>
    </ns0:InputDateString>
    Output:
    <ns0:OutputDate xmlns:ns0="http://DateFormat.DestinationSchema">
    <Date>0000-00-00</Date>
    </ns0:OutputDate>
    If this answers your question please mark as answer. If this post is helpful, please vote as helpful.

  • Convert sysdate to  a julian date 'YYDDD' format    to a number format

    Hi
    I need to be able to convert sysdate to a julian date 'YYDDD' and update the julian as a number data type. Thanks for your help.

    Hi,
    Use TO_CHAR to get a string representation of a date, such as '110008'.
    Use TO_NUMBER to get a NUMBER represnetation of that string.
    SELECT     TO_NUMBER ( TO_CHAR (SYSDATE, 'YYDDD'))
    FROM     dual
    ;Edited by: Frank Kulash on Jan 8, 2011 1:32 PM
    It looks like you accidentally posted 3 copies of the same question, and then, after you realized the msitake, marked them as "Answered". That's very considerate of you. It would be even better if you changed the subject line of all but one of them to "Duplicate - Sorry!"; the remaining one you can leave as "Unanswered" until it really is.

  • APP-AR-12022: A cash receipt with this number,date,amount and customer alre

    Hi,
    There is a caution(Warning message) of Duplicate receipt entery in Oracle AR Receipts entry window which pops up while creating the receipts.
    APP-AR-12022: A cash receipt with this number,date,amount and customer already exists.
    Normally it comes when we enter similar receipt number, net receipt amount and receipt date towice.
    Is it possible to customize the criteria for this caution.
    Thanks.

    You cannot customise this. If you want additional validation at the time of entry/update from forms, you can code special logic in custom pll. But you cannot change the standard functionality.

  • Gettin error Cannot convert to number in RTF Template

    Hi,
    I am working on xml template development i am getting the followinf error
    Font Dir: C:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    RTFProcessor setLocale: en-us
    FOProcessor setData: D:\Tickets\Remittance Advice XMLP\canada_report1.xml
    FOProcessor setLocale: en-us
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(XSLT10gR1.java:586)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(XSLT10gR1.java:383)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(XSLT10gR1.java:201)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(XSLTWrapper.java:161)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:1015)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:968)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:209)
         at oracle.apps.xdo.template.FOProcessor.createFO(FOProcessor.java:1561)
         at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:951)
         at RTF2PDF.runRTFto(RTF2PDF.java:626)
         at RTF2PDF.runXDO(RTF2PDF.java:460)
         at RTF2PDF.main(RTF2PDF.java:251)
    Caused by: oracle.xdo.parser.v2.XPathException: Cannot convert to number.
         at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:1526)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:517)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:485)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:264)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:150)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:187)
         ... 16 more
    I have checked the code and problem was due to following code i dont know where i went wrong
    <xsl:variable xdofo:ctx="incontext" name="inner_group" select=".//G_SEL_INV_DATA"/><?for-each:$inner_group?><?if:(position()-1) mod $no_of_lines_per_page=0?><xsl:variable name="first_rec" xdofo:ctx="incontext" select="position()"/>
    Please help me to solve this issue...
    Thanks
    Rajesh

    What was the problem in the template? I am facing the same error, when I put a conditional in the data field, it throws the XML-22036: (Error) Cannot convert to number.
    error, where if the element was printed directly it works fine.
    error
    <Line 984, Column 130>: XML-22036: (Error) Cannot convert to number.
    @Line 984 ==> <xsl:variable name="v148" select="format-number(string(xdoxslt:one($v147)), string('###0.00'), string('_DECIMALFORMAT'))"/>
    End of Process.
    <format>
    Number, ###0.00
    <DATA >BROKEN
    If (to_number(../DocumentPayableCount) + to_number(Extend/NumberOfPO) + sum(to_number(../DocumentPayable/Extend/Commentlength))) <= 7 then Extend/InvoiceAmount end if
    <DATA >ALSO BROKEN
    If (../DocumentPayableCount + Extend/NumberOfPO + sum(../DocumentPayable/Extend/Commentlength)) <= 7 then Extend/InvoiceAmount end if
    <DATA> WORKS
    then Extend/InvoiceAmount

  • Convert time in miliiseconds to date format

    I have a column in my table with datatype number(38,0) , in that column i have values in form of miliseconds since 1970 e.g 1152567973042...
    i have a requirement to convert this time in milliseconds to today's date, which i can do as
    1152567973042 / 3600 / 24 / 365 == x
    1970 + x = today's date
    is there a function in oracle supporting this, or i have to customize my requirements and write a function.
    Thanks in anticipation

    Your function will not work precisely because it does not account for leap years. You should use Oracle date math. If you add a number to an Oracle date datatype, it assumes that the number is in days. Oracle will automatically account for leap years. Try this:
    DECLARE
    mydate DATE;
    milliseconds_since_1970 NUMBER(30,7);
    BEGIN
    milliseconds_since_1970 := ?;
    mydate := TO_DATE( '01-JAN-1970', 'DD-MON-YYYY') + milliseconds_since_1970/(1000*60*60*24);
    DBMS_OUTPUT.PUT_LINE('mydate = ' || to_char( mydate, 'DD-MON-YYYY HH24:MI:SS' ) );
    END;
    This converts your milliseconds (replace ? with the number) to days and then adds the days to January 1, 1970. The result is an Oracle date datatype adjusted for leap years.
    Oracle date datatypes have hours, minutes, and seconds. Since these were not specified for 1/1/1970, they default to zero. Since milliseconds_since_1970 has 7 decimal places, it will contain fractional days which Oracle converts to hours, minutes, and seconds.
    I'm not sure what format Oracle stores date datatypes in. You have to convert them with a format string every time you use them.
    Kevin Tyson

Maybe you are looking for

  • What's Wrong with My MacBook Pro? Unresponsive, Loud Fan...

    Hi, I've got a Mid 2011, MacBook Pro. 250gb HDD, 4gb Ram, running 10.7.5. Everything was working fine, then I took my MacBook to Mexico for a few weeks, so the power source was different to UK. Worked fine for a few days, but then it seems that after

  • Add columns in system matrix

    Hi experts, I need help urgently. I want to add columns in the matrix of A/R invoice system form. Can someone give me a solution? Regards. Olivier

  • Funny noises, beachballs and application hangs (MacBook Pro 2010)

    Hi, My late 2010 model 17 inch MacBook Pro frequently makes an odd noise (seeming to come from the left side) when I am using it.  It sounds a bit like a click or a whirr (or both); if this happens application I am using will often hang for seconds t

  • Failed to resolve JCO destination name 'WD_SO_INTERNAL_RFC_METADATA_DEST' i

    Hi  All, In the webdynpro content administrator. All the 'create ,the other links like 'test', 'preview','edit','ping','remove' are all disabled. when i am trying to access the webdynpro application i am getting the following error. can any body tell

  • Importing PSD Text Problem

    Hi All, I have searched high and low through Google for an answer to the following problem - but to no avail. Basically i am importing a PSD banner design into Flash CS4 professional. I've used the import to stage option and have selected place layer