Converting Unix Date in Query

<p>Hello everybody,</p><p> </p><p>i connect with brio 8.5 to a SQL database and get the unixdate.Is there a function or anything to convert this to the normaldate?</p><p>Or which formular can do this for me. Thank you inadvance.</p><p> </p>

Hi Maya
Date 2 = Date 1 + Number it works in BW,
say you have date 12/10/2007 then 12/10/2007 + 3 will give u 15/10/2007
I have done the same in routines and it worked there....just try to create a CKF and do this  and let me know if it works in query as well..
Thanks
Tripple k

Similar Messages

  • Converting unix data to normal date time.

    Post Author: Keshavan
    CA Forum: Formula
    Hi,
    Can anyone help me out on how to convert the unix date time format to normal date time? I should convert this unix data to proper time format also with GMT+5:30 hrs. Please help me to do the same.
    Thanks in advance,
    Keshavan.

    Post Author: V361
    CA Forum: Formula
    Could you provide some samples, I am not sure what a Unix data time looks like.
    Unix date that displays:
    Date you want to display:

  • Convert unix datetime to GMT

    Hi,
    I am trying to convert unix date time to GMT time. Need help in doing so.
    Sample unix datetime: 1150142460
    Thanks,
    Karthik
    Message was edited by:
    rkar20

    The format that you want to see the date displayed in. And (key point here) don't forget to call the setTimeZone method of the SimpleDateFormat object to see the date formatted as if it were in GMT.

  • How to convert string date to long (or Unix date)?

    I'm having difficulty in converting a user supplied date in the format mm/dd/yyyy to a long format such as 1035462807000. Since it's being entered by the user I can't just use the current system date. Any suggestions? Thanks!
    Dave

    Hi man, tsith Gave a good beggining, why dont you try the next code
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.text.ParseException;
    import java.util.Date;
    public class DateToUnix{
        public static void main(String args[]){
            getDateAsLong();
        public static void getDateAsLong(){
            String sStartDate = "12/01/2002";
            Date theDate;
            DateFormat sdf= new SimpleDateFormat("MM/DD/yyyy" );
            try {
                theDate = sdf.parse( sStartDate );
            }catch(ParseException e ){
                theDate = new Date();
            System.out.println( "Converted Start Date:" + theDate.getTime());
    }No mather how you get a Date object, the value you are looking for is a long, and you can get it from such object with the getTime() method.
    Take a look at the Java API @ [http://java.sun.com/j2se/1.4.1/docs/api/java/util/Date.html#getTime()]

  • Help: How to call a user defined function in a data block query?

    I created a string aggregation function in the program unit, see reference:
    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
    I now like to call the function in my data block query. I got the error: ORA-00904: 'concatenate_list' invalid identifier.
    Please help.
    Thank you in advance.
    Jimmy

    Hi,
    You can write UDFs in java in Graphical mapping to enhance your XI Graphical mapping functionality
    The steps for doing it would be:
    1. Click on Create New function Button found on Bottom left corner on your XI Mapping window.
    2. Write your java code.
    3. Run the Mapping Test as usual.
    >>The module that is given here ...where and how it is used.
    The adapters in the Adapter Framework convert XI messages to the protocols of connected external systems and the other way around. When doing so, some
    functionality might need to be added specific to a situation which is possible with the use of custom modules.
    Typical example would be validation of file content when using a File Adapter or modification of the message payload to a common content structure which is not supported by any of the standard SAP modules.
    An Adapter module is developed as an Enterprise Java Bean and is called locally by the Adapter.
    An example on modules :
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/da5675d1-0301-0010-9584-f6cb18c04805">How to develop a module for reading file name in a sender file adapter XI 3.0</a>
    Cheers,
    Chandra

  • Convert the date of string to datetime format 'MM/dd/yyyy' when the system date format is 'dd/MM/yyyy'.

    I need convert the date of string format 'MM/dd/yyyy' to datetime format 'MM/dd/yyyy' when the system date format is 'dd/MM/yyyy'.Since
    I need to search values based on date where my database datetime  is 'MM/dd/yyyy' format.

    In my opinion you should re-consider the assumption that the date picker returns a string. Maybe it is able to return a
    DateTime object directly instead of string. Then you will pass this value as a parameter of SQL query. This should work regardless of computer configuration.
    Otherwise, follow the previous string-based approaches.

  • VI to convert Unix time to standard time?

    hi,
    I am in need of a VI to convert Unix time to Standard time?
    eg: Unix time: 1268845177 in seconds
    Standard time: GMT: Wed, 17 Mar 2010 16:59:37 GMT
                            Your timezone(U.S):
    Wednesday, March 17, 2010 10:59:37 AM
    I have the calculation but not full formula.
    Unix time is in seconds from Jan 1,1970, 00:00:00 UTC, starting at 0 counting forward.
    When 1268845177/86400 = 14685 days.
    86400 = 60*60*24 seconds
    But how to convert the 14685 days and relate to the current date, how it should be done?
    Either the formula or a VI to convert Unix time to standard time will be a help.
    Regards,
    Arvinth

    Timestamps and the PC clock vs. time on the net are different and I'd say somewhat unrelated concepts.
    You are worried about accuracy of the current time.  Timestamps have nothing to do with current time, but are a way of identifying and particular moment in time.
    Yes, the PC clock gets its time from the net assuming the time server settings are all set properly.  Even the correction of the current PC time may not happen exactly when the leap second gets inserted.  It may be some time before the PC resynchronizes with the net time.  The PC doesn't know if the existence of when a leap second will occur.  And neither does the LabVIEW timestamp.
    Here is an example.  According to http://en.wikipedia.org/wiki/Leap_second, a leap second will occur at the end of June 30 of this year UTC.  Since my clock is eastern daylight time at that date, I put together an example for 8pm on June 30  (UTC +4).  You'll see that the 3 values (a second before, the exact time, and a second after) show they are all 1 second apart.  There is no extra second accounted for.  So in real life the time a second after  vs. a second before are actually 3 seconds apart, but LabVIEW only show 2 seconds.  Feel free to play with the attached snippet for different timezones and daylight savings time and all of that.
    I don't think you really have as big of a problem as you are trying to investigate here.  If your timing needs are that critical where you need accuracy of the current time to better than a second, then you shouldn't be looking at LabVIEW timestamps, PC time clock, or internet time at all, but look at a high accuracy timing source perhaps based on a GPS clock.
    Unless you have a particular test planned to run over the expected point of time where a leap second is inserted, then you shouldn't have to worry.  Even if you do have a test run over the leap second, you probably don't need to worry either.  If the test is based on a waveform datatype, then you have a T0 timestamp, and a dT that will keep track of all the individual data points accurately.
    Attachments:
    Example_VI.png ‏20 KB

  • CONVERT INVERTED-DATE

    Hi Experts,
                    can anybody explain below example..
    DATA: odate TYPE d VALUE '19955011',
               idate LIKE odate.
    CONVERT DATE odate INTO INVERTED-DATE idate.
    CONVERT INVERTED-DATE idate INTO DATE odate.
    Thanks in advance..
    shobha henry

    Hi,
    Convert date routine is mainly used in case you are querying date field in a currency table example TCURR.
    Assume an internal table containing following dates:
    18.3.2006
    17.3.2006
    19.3.2006.
    If we sort the internal table by date ascending, then the sequence would be:
    17.3.2006, 18.3.2006 and 19.3.2006.
    Now in another internal table have another internal table with actual date and converted date. Convert the actual date into inverted date and populate into the second field.
    Now if you give a sort ascending by the converted date field the sequence will be:
    19.3.2006, 18.3.2006 and 17.3.2006. This means the latest(youngest) gets on top.
    This will be very useful when querying currency table to find latest exchange rates / exchange rate between a given period.
    TABLES: tcurr.
    PARAMETERS: p_date LIKE sy-datum.
    DATA: c_date LIKE sy-datum.
    SELECT SINGLE ukurs INTO tcurr-ukurs FROM tcurr WHERE
                                              kurst = '1001' AND
                                              fcurr = 'DEM' AND
                                              tcurr = 'USD' AND
                                              gdatu = p_date.
    WRITE:/ tcurr-ukurs.
    CONVERT DATE p_date INTO INVERTED-DATE c_date.
    SELECT SINGLE ukurs INTO tcurr-ukurs FROM tcurr WHERE
                                              kurst = '1001' AND
                                              fcurr = 'DEM' AND
                                              tcurr = 'USD' AND
                                              gdatu = c_date.
    WRITE:/ tcurr-ukurs.
    Put a breakpoint after convert statement and see for yourself.
    Thanks and regards,
    S. Chandra Mouli.

  • How to convert a data set into a xml data and vice versa

    i am new to oracle with xml..
    my aim is to convert a data set into a xml data and vice versa..
    my work is as follows...
    my query:
    select rggpk,rggcode,rggname from ms_regiongeo
    to convert a data set into a xml*
    select XMLType(trim(replace(dbms_xmlgen.getXML('select rggpk,rggcode, rggname from ms_regiongeo'),'<?xml version="1.0"?>',''))) XML_DATA from dual;
    (this works fine and output of this query is as follows..)
    <ROWSET>
    <ROW>
      <RGGPK>201</RGGPK>
      <RGGCODE>Asia</RGGCODE>
      <RGGNAME>Asia</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>1</RGGPK>
      <RGGCODE>OTH</RGGCODE>
      <RGGNAME>Others</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>21</RGGPK>
      <RGGCODE>COB</RGGCODE>
      <RGGNAME>Africa and Yemen</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>2</RGGPK>
      <RGGCODE>AUS</RGGCODE>
      <RGGNAME>Australia</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>23</RGGPK>
      <RGGCODE>IND</RGGCODE>
      <RGGNAME>Indian Sub Continent</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>24</RGGPK>
      <RGGCODE>TVM</RGGCODE>
      <RGGNAME>North America</RGGNAME>
    </ROW>
    </ROWSET>
    and to reverse this process, I tried a query like this..*
    select EXTRACTVALUE (XML_DATA,'ROWSET/ROW/RGGPK') as EMP_ID
    from(
            select XMLType(trim(replace(dbms_xmlgen.getXML('select rggpk,rggcode, rggname from ms_regiongeo'),'<?xml version="1.0"?>',''))) XML_DATA from dual
    )tab1but failed.. and raised with an eror: ORA-19025
    help me..
    regards,
    john

    Hi-
    my aim is to convert a data set into a xml data  You can refer to the below posts
    Adding namespace to XML output
    Re: how to convert table data in xml format based on the xsd.

  • Converting OTF data from script to Spool Request

    Hello,
    Is there any way to convert OTF data into Spool Request.
    Actual scenario is for the Order Acknowledgement form they have configured the output type for Print Medium and here the spool is generated through Close_Form . Based on the spool no they are converting the spool to PDF and then placing a copy in the Unix Directory.
    They have also configured the form for Fax Medium , but here in the close_form they are getting the Fax number instead of spool number. As this way it just Fax the output to required destination , user require a copy of the output should be converted to PDF and then it has to be placed in Unix directory as it is happening for print medium.
    The problem here in the close form for first  case , i can see the spool id but in the second case that is not happening . So only OTF data is available with me. So is there any way where i can pass OTF data get spool id . So that if i have spool id rest will be taken care by my existing logic.
    I Appreciate your valuable inputs.
    Thanks,
    Subash

    Check this code snippet.
    data : it_spool      TYPE STANDARD TABLE OF rsporq     ,
                         it_pdf        TYPE STANDARD TABLE OF tline      ,
                         v_objtype     TYPE rststype-type   ,
                        v_name        TYPE rststype-name  .
    *&      Form  find_spool_request_id
    FORM find_spool_request_id.
      CALL FUNCTION 'RSPO_FIND_SPOOL_REQUESTS'
        EXPORTING
          allclients          = '320'
          datatype            = '*'
          has_output_requests = '*'
          rq0name             = nast-dsnam
          rq1name             = '*'
          rq2name             = '*'
          rqdest              = 'LOCL'
          rqowner             = sy-uname
        TABLES
          spoolrequests       = it_spool
        EXCEPTIONS
          no_permission       = 1
          OTHERS              = 2.
      IF sy-subrc <> 0.
        MESSAGE i000 DISPLAY LIKE 'E' WITH text-002.
        LEAVE LIST-PROCESSING.
      ENDIF.
    ENDFORM.                    " find_spool_request_id
    *&      Form  convert_spool_to_pdf
    FORM convert_spool_to_pdf .
      READ TABLE it_spool INTO wa_spool INDEX 1.
      v_spoolno = wa_spool-rqident.
    *Get Spool request attributes
      SELECT SINGLE *
        FROM tsp01
        INTO tsp01
        WHERE rqident EQ v_spoolno.
      IF sy-subrc <> 0.
        MESSAGE i000 DISPLAY LIKE 'E'
                          WITH text-003 v_spoolno text-034.
        LEAVE LIST-PROCESSING.
      ENDIF.
      v_client = tsp01-rqclient.
      v_name   = tsp01-rqo1name.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
        EXPORTING
          authority     = 'SP01'
          client        = v_client
          name          = v_name
          part          = 1
        IMPORTING
          objtype       = v_objtype
        EXCEPTIONS
          fb_error      = 1
          fb_rsts_other = 2
          no_object     = 3
          no_permission = 4
          OTHERS        = 5.
      IF sy-subrc <> 0.
        MESSAGE i000(zz) DISPLAY LIKE 'E'
                           WITH text-003 v_spoolno text-034.
        LEAVE LIST-PROCESSING.
      ENDIF.
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
          EXPORTING
            src_spoolid              = v_spoolno
            no_dialog                = ' '
          TABLES
            pdf                      = it_pdf
          EXCEPTIONS
            err_no_otf_spooljob      = 1
            err_no_spooljob          = 2
            err_no_permission        = 3
            err_conv_not_possible    = 4
            err_bad_dstdevice        = 5
            user_cancelled           = 6
            err_spoolerror           = 7
            err_temseerror           = 8
            err_btcjob_open_failed   = 9
            err_btcjob_submit_failed = 10
            err_btcjob_close_failed  = 11
            OTHERS                   = 12

  • Could not convert the data value due to reasons other than sign mismatch or overflow. ADSI Provider

    I'm trying to run the following query against Active Directory using the ADSI Provider using SSMS 2012 SP1:
    SELECT
    TOP901
    *FROMOpenQuery
      ADSI
    'SELECT description
      FROM  ''LDAP://OU=MMICorporate,DC=mmis,DC=mi,DC=com''
      WHERE objectClass =  ''User''
    and objectcategory = ''Person''
    and ''userAccountControl:1.2.840.113556.1.4.803:''<>2
    )AStblADSI
    Msg 7346, Level 16, State 2, Line 2
    Cannot get the data of the row from the OLE DB provider "ADsDSOObject" for linked server "ADSI". Could not convert the data value due to reasons other than sign mismatch or overflow.
    I only have this issue querying the Description Field. 
    I also found a hotfix KB: 887474 for this but it is for Windows 2003.  SQL Server OS I have is Server 2008 R2.  Is there a fix for 2008 R2?
    Thanks

    Thanks for the quick response.
    I checked out the link and I can only convert to Ul8 and when I try I get the same error:
    SELECT
    TOP901
    *FROMOpenQuery
      ADSI
    'SELECT name, convert(UI8, description)
      FROM  ''LDAP://OU=MMICorporate,DC=mmis,DC=mi,DC=com''
      WHERE objectClass =  ''User''
    and objectcategory = ''Person''
    and ''userAccountControl:1.2.840.113556.1.4.803:''<>2
    )AStblADSI
    Am I missing something?
    Thanks

  • Not able to access data in Query

    Hi,
    I have loaded data using DTP from 2 different source systems.
    One is 3.x emulated datasource and the other is New 7.0 datasource.I have loaded data sucessfully in to DSO.Built a query on same.
    But when iam executing the query by material as selection criteria.Iam not able to found data in query from one source system.The same data is available in DSO.Please needed in this regard.

    Hi Venkat,
    After extracting data into DSO check the request whether active or not.
    Check data in DSO in contents.
    If is there any restrictions on info providers in Queries.
    Let us know status clearly.......
    Reg
    Pra

  • How can I convert a .dat to a .zip on a Mac?

    Hi -
    I friend wanted me to update his company's website which runs on a MS Exchange Server/Sharepoint set up.  He zipped all the html, jpeg, and assorted text files and attached that zip file to an email.  When I received it on my Mac it had been converted to a ".dat" file.  He tells me that this is the result of sending a zipped file over the MS Exchange Server mail system to a Mac. (Whatever happened to cross-platform?)
    Is there a Mac utility I can use to convert this dat file back to a zip file that I then can open on my Mac?
    TIA
    Josh

    Hello:
    This article addresses your issue:
    http://docs.info.apple.com/article.html?path=Mail/10.7/en/mlhlp1141.html
    Barry

  • How can i convert the date from M to MM ?

    Dear Guru ,
    I need to upload my list to SAP table , and in the list , we are using YYYY/M/D format ( Eg. 2010/5/20 , 2010/10/1 ) .
    And now i want to convert all date format to YYYY/MM/DD , Is it possibile to do that ?
    Here is my code , but it doesn't work . It returned "2009//3//5" format .
    data: ld_date_int type datum.
    data : test(10) type c.
    test = '2009/3/5' .
    ld_date_int = test .
    WRITE : SY-SUBRC , LD_DATE_int .
    Does SAP provide a standard function can convert the date format ?
    Thanks .
    Best Regards,
    Carlos Zhang

    Hi Dear
    You can try in this way :::
    data: ld_date_int type string.
    DATA : ld_string TYPE string.
    data : test(10) type c,
           ld_res1(4) TYPE c,
           ld_res2(2) TYPE c,
           ld_res3(2) TYPE c.
    DATA : ll_res2 TYPE i,
           ll_res3 TYPE i.
    test = '2009/03/5' .
    ld_date_int = test .
    ld_string = strlen( ld_date_int ).
    CASE ld_string.
      WHEN 10.
       WRITE : SY-SUBRC , LD_DATE_int.
      WHEN OTHERS.
        SPLIT ld_date_int at '/' INTO ld_res1 ld_res2 ld_res3 in CHARACTER MODE.
        ll_res2 = strlen( ld_res2 ).
        ll_res3 = strlen( ld_res3 ).
        IF NOT ll_res2 eq 2 and not ll_res3 eq 2.
          CONCATENATE: '0' ld_res2 INTO ld_res2.
          CONCATENATE: '0' ld_res3 INTO ld_res3.
          CONCATENATE ld_res1 '/' ld_res2 '/' ld_res3 INTO ld_date_int.
          WRITE : SY-SUBRC , LD_DATE_int.
        ENDIF.
        IF ll_res2 eq 2 and not ll_res3 eq 2.
          CONCATENATE '0' ld_res3 INTO ld_res3.
          CONCATENATE ld_res1 '/' ld_res2 '/' ld_res3 INTO ld_date_int.
          WRITE : SY-SUBRC , LD_DATE_int.
        ENDIF.
        IF NOT ll_res2 eq 2 and ll_res3 eq 2.
           CONCATENATE: '0' ld_res2 INTO ld_res2.
            CONCATENATE ld_res1 '/' ld_res2 '/' ld_res3 INTO ld_date_int.
             WRITE : SY-SUBRC , LD_DATE_int.
        ENDIF.
    ENDCASE.

  • How Can I use a Variable  in Data Controls query. Frank Kindly check...

    Hii,
    I am using JDeveloper 11g ADF BC.
    My Requirement is that I hv a login screen which is taken from [http://blogs.oracle.com/shay/simpleJSFDBlogin.zip].
    I hv attached BC in this application. I want to use the login usercode in the next pages after login screen. Next screen contains 3 list items which will be populating based on the user. So I created &lt;af:selectOneChoice&gt; using the BC( Just drag & dropped the column into the page from the data controls). But in the data control i want to use this usercode for passing the condition. Now Data is coming without any condition.
    So How can I use the usercode in the Data controls query.
    When I tried to display the usercode in the next page it is showing by binding the value. its code is follows
    &lt;af:outputText value="#{backing_getUser.uid}"
    The program for checking the username & Password is follows.
    package login.backing;
    import oracle.adf.view.rich.component.rich.RichDocument;
    import oracle.adf.view.rich.component.rich.RichForm;
    import oracle.adf.view.rich.component.rich.input.RichInputText;
    import oracle.adf.view.rich.component.rich.layout.RichPanelFormLayout;
    import oracle.adf.view.rich.component.rich.nav.RichCommandButton;
    import java.sql.*;
    import java.util.List;
    import java.util.Map;
    import oracle.adf.view.rich.component.rich.output.RichMessage;
    import oracle.jdbc.OracleDriver;
    public class GetUser {
    private RichInputText uid;
    private RichInputText pid;
    private RichCommandButton commandButton1;
    private RichInputText inputText1;
    private RichInputText inputText2;
    public void setUid(RichInputText inputText1) {
    this.uid = inputText1;
    public void setPid(RichInputText inputText2) {
    this.pid = inputText2;
    public RichInputText getUid() {
    return uid;
    public RichInputText getPid() {
    return pid;
    public void setCommandButton1(RichCommandButton commandButton1) {
    this.commandButton1 = commandButton1;
    public RichCommandButton getCommandButton1() {
    return commandButton1;
    public String login_action() {
    // Add event code here...
    String user = this.getUid().getValue().toString();
    // String pass = inputText2.getValue().toString();
    String pid = this.getPid().getValue().toString();
    Connection conn;
    conn = getConnection();
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery ("SELECT usercode FROM guser where usercode = '"+user.toUpperCase()+"' and pwd=F_TEST('"+pid.toUpperCase()+"')");
    if (rset.next()) {
    conn.close();
    return "good";
    conn.close();
    } catch (SQLException e) {
    System.out.println(e);
    return "bad";
    public static Connection getConnection() throws SQLException {
    String username = "ACCTS";
    String password = "ACCTS";
    String thinConn = "jdbc:oracle:thin:@SERVER1:1521:G5PS";
    DriverManager.registerDriver(new OracleDriver());
    Connection conn =
    DriverManager.getConnection(thinConn, username, password);
    conn.setAutoCommit(false);
    return conn;
    public void setInputText1(RichInputText inputText1) {
    this.inputText1 = inputText1;
    public RichInputText getInputText1() {
    return inputText1;
    public void setInputText2(RichInputText inputText2) {
    this.inputText2 = inputText2;
    public RichInputText getInputText2() {
    return inputText2;
    -----

    Hi,
    I didn't look at the example, but if you want to secure your application then you should use container managed security. Read this .
    Anyway, you could add this before return "good"; in your login_action()
    FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("username", user);Then, you can access this from anywhere in the application by using #{sessionScope.username}.
    Pedja

Maybe you are looking for

  • Problem with searching in weblogic 8.1 repository..

              Can anyone help me to Search in WebLogic 8.1 Content Mangement...Data base....           we are using weblogic 8.1 content management (i.e. repositor to store the data           of poral..)           Now I m implementing Search in repositor

  • With out using IDX2.....in file to idoc scenario

    Hi Masters,                    i have one doubt .. Can i send normal file from sender system to sap system in the form of idoc.. with out using IDX2... if it is possible then plz explain me about the steps .. and also explain me wht is the actual use

  • Download trouble with Firefox

    I implemented download in apex application with PL/SQL process (process point On Load - Before Header). Anonymous block: declare l_blob BLOB; l_length number; begin dbms_lob.createtemporary(l_blob, false); dbms_lob.writeappend(l_blob, length('test'),

  • Directory structure in sap

    Hi All What is the Tr code to see the directory structure in SAP. Regards T2

  • How to creating a default for batch naming files?

    I am currently going through a whole bunch of projects and am trying to batch rename the images. Each time, I have to make the changes I want in the batch rename box. Is there a way of creating a custom default (e.g. year, name, number) so that I don