Data Joins and Pivot Help

Hi, I have one fact table and one huge history table that goes really deep with scores stored with month end dates.
I am looking for a way to manipulate the month and year of DateChanged in table A along with joins on the acct no to retrieve scores from previous months, resulting in a de-normalized data format as in the result table.
Any ideas?? Thanks!
Table A
Acct     DateChanged
123     1/12/2008
456     8/25/2008
Table B:
Acct           DateUpload        Score
123           11/30/2007        620
123           12/31/2007        650
123           01/31/2008        712
123           02/29/2008        800
456           05/31/2008        520 
456           06/30/2008        630
456           07/31/2008        680
456           08/31/2008        710
456           09/30/2008        780
456           10/31/2008        786
456           11/30/2008        823
Result Table:
Acct      Score2MonthPrior     Score1MonthPrior
123            620                     650
456            630                     680

If you understood your reqs correctly, it should be:
with a as (
           select 123 acct,to_date('1/12/2008','mm/dd/yyyy') date_changed from dual union all
           select 456,to_date('8/25/2008','mm/dd/yyyy') from dual
     b as (
           select 123 acct,to_date('11/30/2007','mm/dd/yyyy') date_upload,620 score from dual union all
           select 123,to_date('12/31/2007','mm/dd/yyyy'),650 from dual union all
           select 123,to_date('01/31/2008','mm/dd/yyyy'),712 from dual union all
           select 123,to_date('02/29/2008','mm/dd/yyyy'),800 from dual union all
           select 456,to_date('05/31/2008','mm/dd/yyyy'),520 from dual union all
           select 456,to_date('06/30/2008','mm/dd/yyyy'),630 from dual union all
           select 456,to_date('07/31/2008','mm/dd/yyyy'),680 from dual union all
           select 456,to_date('08/31/2008','mm/dd/yyyy'),710 from dual union all
           select 456,to_date('09/30/2008','mm/dd/yyyy'),780 from dual union all
           select 456,to_date('10/31/2008','mm/dd/yyyy'),786 from dual union all
           select 456,to_date('11/30/2008','mm/dd/yyyy'),823 from dual
      c as (
            select  acct,
                    date_upload,
                    score,
                    lead(date_upload,1,sysdate) over(partition by acct order by date_upload) next_date_upload
              from  b
select  acct,
        (select score from c where a.acct = c.acct and add_months(date_changed,-2) >= date_upload and add_months(date_changed,-2) < next_date_upload) Score2MonthPrior,
        (select score from c where a.acct = c.acct and add_months(date_changed,-1) >= date_upload and add_months(date_changed,-1) < next_date_upload) Score1MonthPrior
  from  a
      ACCT SCORE2MONTHPRIOR SCORE1MONTHPRIOR
       123                               620
       456              520              630
SQL> Two months prior 1/12/2008 is 11/12/2007 which falls before the earliest record for acct 123. One month prior 1/12/2008 is 12/12/2007 which falls between 11/30/2007 and 12/31/2007 and therefore score should be 620, not 650.
SY.

Similar Messages

  • Date selection and search help component in jsp

    Hi all:
        In sap portal jsp development enviorment, is it possible to easily program the date selection and search help ( just look like search help in webdynpro ) ?

    Hello Jianhong,
    the easiest way to set a value help is using HTMLB component in your JSP.
    To do it, use next code:
    <hbj:inputField
               id="DateInputField"
               type="date"
               showHelp="TRUE"
               ... other attributes
    />
    Before using HTMLB components in your JSP, don't forget to add this line to your page:
    <%@ taglib uri= "tagLib" prefix="hbj" %>
    regards.
    mz

  • Illustrator Data Sets and Variables Help Please

    Hi, how's everyone doing?  I need a little help with Data Sets and Variables, or at least i believe that's what i need help with.  Ultimately i am trying to run an action on a batch of files. 
    I have an eps file with two images placed side by side.  They are the same image.  I am trying to replace both images and save the file accordingly.  Trying to make this happen using a bunch of files.  All the files can be in one folder and will be the same size. 
    I hope this make sense and what i need done is doable.
    Any help or advise would be greatly appreciated.
    Thanks in advance.

    Not sure a I read you correctly but if I understand you
    what you have to do is make the first two images as dynamic variables using the variable panel and save it as a data set
    then replace those two images and save those as a data set
    So now you have data set one and two.
    You can save that as an variable library (xml)and that can be loaded into other documents.
    The question is can it be actioned?
    It can be scripted and do you want the same two images to replace the same two image in each document.
    I think you really have to tell us more.

  • XML Data Server and model help

    All,
    I have the following files
    1) travel.dtd
    2) travel.xml.
    I've set up a XML data server with JDBC driver com.sunopsis.jdbc.driver.xml.SnpsXmlDriver and URL = jdbc:snps:xml?d=c:/XML/travel.dtd. I have created a model in designer and have successfully reversed the datastores generated from the dtd.
    The travel.xml file has data populated within it, but when I right click on the datastores, there is nothing displayed. This makes sense because the xml server is configured to point at the .dtd. Do I need to change my topology connection to connect to the xml document as opposed to the dtd. Can someone tell me what i'm missing?
    thanks for your help.

    Since its not displaying anything as you are saying you just change the property to "f" and check.
    Example
    jdbc:snps:xml?f=/xml/myxml.xml&d=/xml/myxcd.xsd&s=MYSCHEMANAME
    ("s=MYSCHEMANAME": This schema will be selected when creating the physical schema under the XML data server.)
    Hope it helps.
    Thanks

  • Inner Join and "PIVOT" results

    Good day all;
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    "CORE     10.2.0.4.0     Production"
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    I have 2 tables that I would like to do a query on and then "pivot" the results. I understand that since this is 10g that the use of PIVOT is not supported.
    (Corrected code issues :))
    create table CT
    DESIGN_ID NUMBER,
    CT_ID VARCHAR2(15) 
    INSERT INTO CT VALUES ('654321','10QWER123456');
    INSERT INTO CT VALUES ('987654','7ASDF654987');
    INSERT INTO CT VALUES ('321654','82CHEV852963');
    create table CXRF
    DESIGN_ID NUMBER,   
    ROW_SEQ_NBR NUMBER,   
    XREF_CT_ID VARCHAR2(15) 
    INSERT INTO CXRF VALUES ('654321','1','25ABCD');
    INSERT INTO CXRF VALUES ('654321','2','262ABCD');
    INSERT INTO CXRF VALUES ('987654','1','14WXYZ');
    INSERT INTO CXRF VALUES ('987654','2','34FRED');
    INSERT INTO CXRF VALUES ('321654','1','1TOM');- Oops measure twice cut once..
    select design_id,
            ct_id,
            xref_ct_id
      from cxrf
         INNER JOIN
           ct
       on(ct.design_id = cxrf.design_id) Desired results would look like this:
    DESIGN_ID             CT_ID            XREF_CT_1     XREF_CT_2
       654321       10QWER123456        25ABCD         262ABCDEdited by: GMoney on May 9, 2013 8:47 AM
    Edited by: GMoney on May 9, 2013 8:49 AM

    Please provide WORKING sql:
    SQL> create table CT
      2  (
      3  DESIGN_ID NUMBER      not null,
      4  CT_ID VARCHAR2(2)
      5  );
    Table created.
    SQL> INSERT INTO CT VALUES ('654321'','10QWER123456');
    ERROR:
    ORA-01756: quoted string not properly terminated
    SQL> INSERT INTO CT VALUES ('987654','7ASDF654987');
    INSERT INTO CT VALUES ('987654','7ASDF654987')
    ERROR at line 1:
    ORA-12899: value too large for column "SCOTT"."CT"."CT_ID" (actual: 11, maximum: 2)
    SQL> INSERT INTO CT VALUES ('321654','82CHEV852963');
    INSERT INTO CT VALUES ('321654','82CHEV852963')
    ERROR at line 1:
    ORA-12899: value too large for column "SCOTT"."CT"."CT_ID" (actual: 12, maximum: 2)
    SQL>
    SQL> create table CXRF
      2  (
      3  DESIGN_ID NUMBER
      4  ROW_SEQ_NBR NUMBER
      5  XREF_CT_ID VARCHAR2(12)
      6  );
    ROW_SEQ_NBR NUMBER
    ERROR at line 4:
    ORA-00907: missing right parenthesis
    SQL> INSERT INTO CXRF VALUES ('654321','1','25ABCD');
    INSERT INTO CXRF VALUES ('654321','1','25ABCD')
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> INSERT INTO CXRF VALUES ('654321','2','262ABCD');
    INSERT INTO CXRF VALUES ('654321','2','262ABCD')
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> INSERT INTO CXRF VALUES ('987654','1','14WXYZ');
    INSERT INTO CXRF VALUES ('987654','1','14WXYZ')
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> INSERT INTO CXRF VALUES ('987654','2','34FRED');
    INSERT INTO CXRF VALUES ('987654','2','34FRED')
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> INSERT INTO CXRF VALUES ('321654','1','1TOM');
    INSERT INTO CXRF VALUES ('321654','1','1TOM')
    ERROR at line 1:
    ORA-00942: table or view does not exist:p

  • FLV and SWF Joining and Resizing - Help?!?!

    Greets,
    My wife is a copy writer, and as part of her portfolio, she has to go and capture the end result once it has been shot. In the current perplexing case, a web site has a small speaking host who will occasionally point to the right at an animation. The host is on the site as a FLV and the animation is a SWF. I guess it makes sense for them, but it certainly seems like they could have gone the extra mile to make it one file.
    Anyway, I have captured the FLV and the SWF, but am having a VERY hard time combining them, even after reencoding both into AVI. For the most part, they are very different dimensions, and when all is said and done, the result is blocky probably because the exported dimensions are too big.
    My main problem is that the video size is set at the time you set up a project, and no amount of trial and error on my part has allowed me to figure out what to set that to.
    Any help on any of this is greatly appreciated!
    Thanks!

    Is there any option to get source materials from the host? Do you have a link to this site so we can take a look?

  • Re: Data base and Website help

    I just posted some urls on this thread:
    http://forum.java.sun.com/thread.jspa?threadID=5260879&tstart=0
    Radhika
    http://blogs.sun.com/NetBeansSupport

    check these links for db connections
    https://forums.sdn.sap.com/click.jspa?searchID=8781708&messageID=4514862
    https://forums.sdn.sap.com/click.jspa?searchID=8781708&messageID=4822522
    https://forums.sdn.sap.com/click.jspa?searchID=8781708&messageID=4730662
    https://forums.sdn.sap.com/click.jspa?searchID=8781708&messageID=4737927
    https://forums.sdn.sap.com/click.jspa?searchID=8781708&messageID=4428837
    regarding trace files they are just log files where you can see if there are errors encountered in the portal and you can check them using http://host:port/nwa----monitoring-logs and traces
    reward points if hellpful

  • What is the significance of data collection nad search help exit field ?

    Dear Gurus
    I  know i am asking very basic quetion of abap but sdn is  the only source to learn sap for me.I want to thanks you all for your kind support.
    i read  most of the post related to search help and trying to create one.
    for elementary search help.
    SE11 -> SEACH HELP -> ELEMENTARY SEARCH HELP
    I have doubts regarding to fields "DATA COLLECTION" and "SEARCH HELP EXIT".
    reference to a  tutorial it is a maintenance view  shall i  have to reate  a maintenace view first.
    and other field is  SEARCH HELP EXIT what is this.
    please help me .
    Thanks in advance.
    Chitta Ranjan mahato.
    Edited by: chitto123 on Oct 8, 2010 5:59 AM

    Howdy,
    DATA COLLECTION - refers to a database table or view.  This is the data that the search help will search through and display based on the parameters provided, so you can create your own view for the search help if you want the search to cover multiple tables.
    SEARCH HELP EXIT - You can create a function module to be able to alter the Search Help's selection and results at various events throughout the search help.  An example of this function module is provided with some documentation in function module F4IF_SHLP_EXIT_EXAMPLE.
    Cheers
    Alex

  • Please help to get onhand stock report with last purchase and billed date warehouse and item wise

    please help to get onhand stock report with last purchase and billed date warehouse and item wise

    Hi Rajeesh Ambadi...
    Try This
    SELECT distinct T0.ITEMCODE , t1.ItemName, T0.ONHAND as 'Total Qty',  
      T1.LASTPURDAT ,t1.LastPurPrc
    FROM OITW T0 INNER JOIN OITM T1 ON T0.ITEMCODE = T1.ITEMCODE
    INNER JOIN OITB T2 ON T1.ITMSGRPCOD=T2.ITMSGRPCOD left join ibt1 t3 on t3.itemcode = t0.itemcode and t3.whscode = t0.whscode
    WHERE
    T0.ONHAND>0
    AND T0.WhsCode ='[%0]'
    Hope Helpful
    Regards
    Kennedy

  • Need help in optimizing the query with joins and group by clause

    I am having problem in executing the query below.. it is taking lot of time. To simplify, I have added the two tables FILE_STATUS = stores the file load details and COMM table that is actual business commission table showing records successfully processed and which records were transmitted to other system. Records with status = T is trasnmitted to other system and traansactions with P is pending.
    CREATE TABLE FILE_STATUS
    (FILE_ID VARCHAR2(14),
    FILE_NAME VARCHAR2(20),
    CARR_CD VARCHAR2(5),
    TOT_REC NUMBER,
    TOT_SUCC NUMBER);
    CREATE TABLE COMM
    (SRC_FILE_ID VARCHAR2(14),
    REC_ID NUMBER,
    STATUS CHAR(1));
    INSERT INTO FILE_STATUS VALUES ('12345678', 'CM_LIBM.TXT', 'LIBM', 5, 4);
    INSERT INTO FILE_STATUS VALUES ('12345679', 'CM_HIPNT.TXT', 'HIPNT', 4, 0);
    INSERT INTO COMM VALUES ('12345678', 1, 'T');
    INSERT INTO COMM VALUES ('12345678', 3, 'T');
    INSERT INTO COMM VALUES ('12345678', 4, 'P');
    INSERT INTO COMM VALUES ('12345678', 5, 'P');
    COMMIT;Here is the query that I wrote to give me the details of the file that has been loaded into the system. It reads the file status and commission table to show file name, total records loaded, total records successfully loaded to the commission table and number of records that has been finally transmitted (status=T) to other systems.
    SELECT
        FS.CARR_CD
        ,FS.FILE_NAME
        ,FS.FILE_ID
        ,FS.TOT_REC
        ,FS.TOT_SUCC
        ,NVL(C.TOT_TRANS, 0) TOT_TRANS
    FROM FILE_STATUS FS
    LEFT JOIN
        SELECT SRC_FILE_ID, COUNT(*) TOT_TRANS
        FROM COMM
        WHERE STATUS = 'T'
        GROUP BY SRC_FILE_ID
    ) C ON C.SRC_FILE_ID = FS.FILE_ID
    WHERE FILE_ID = '12345678';In production this query has more joins and is taking lot of time to process.. the main culprit for me is the join on COMM table to get the count of number of transactions transmitted. Please can you give me tips to optimize this query to get results faster? Do I need to remove group and use partition or something else. Please help!

    I get 2 rows if I use my query with your new criteria. Did you commit the record if you are using a second connection to query? Did you remove the criteria for file_id?
    select carr_cd, file_name, file_id, tot_rec, tot_succ, tot_trans
      from (select fs.carr_cd,
                   fs.file_name,
                   fs.file_id,
                   fs.tot_rec,
                   fs.tot_succ,
                   count(case
                            when c.status = 'T' then
                             1
                            else
                             null
                          end) over(partition by c.src_file_id) tot_trans,
                   row_number() over(partition by c.src_file_id order by null) rn
              from file_status fs
              left join comm c
                on c.src_file_id = fs.file_id
             where carr_cd = 'LIBM')
    where rn = 1;
    CARR_CD FILE_NAME            FILE_ID           TOT_REC   TOT_SUCC  TOT_TRANS
    LIBM    CM_LIBM.TXT          12345678                5          4          2
    LIBM    CM_LIBM.TXT          12345677               10          0          0Using RANK can potentially produce multiple rows to be returned though your data may prevent this. ROW_NUMBER will always prevent duplicates. The ordering of the analytical function is irrelevant in your query if you use ROW_NUMBER. You can remove the outermost query and inspect the data returned by the inner query;
    select fs.carr_cd,
           fs.file_name,
           fs.file_id,
           fs.tot_rec,
           fs.tot_succ,
           count(case
                    when c.status = 'T' then
                     1
                    else
                     null
                  end) over(partition by c.src_file_id) tot_trans,
           row_number() over(partition by c.src_file_id order by null) rn
    from file_status fs
    left join comm c
    on c.src_file_id = fs.file_id
    where carr_cd = 'LIBM';
    CARR_CD FILE_NAME            FILE_ID           TOT_REC   TOT_SUCC  TOT_TRANS         RN
    LIBM    CM_LIBM.TXT          12345678                5          4          2          1
    LIBM    CM_LIBM.TXT          12345678                5          4          2          2
    LIBM    CM_LIBM.TXT          12345678                5          4          2          3
    LIBM    CM_LIBM.TXT          12345678                5          4          2          4
    LIBM    CM_LIBM.TXT          12345677               10          0          0          1

  • Need help with inner join and distinct rows

    Hey Guys,
    i have
    1) BaseEnv Table 
    2) Link Table
    3) BaseData Table
    Link table has three columns Id,BaseEnvId,BaseDataId 
    the BaseEnvID is unique in the table where as BaseDataId can be repeated i.e multile rows of BaseEnv Table can point to same BaseData  table row
    Now i want to do  BaseEnvTable inner join Link Table inner join BaseData Table and select 5 columsn ; Name,SyncName,Version,PPO,DOM  from the BaseData table.. the problem is that after i do the inner join I get duplciate records..
    i want to eliminate the duplicate records , can any one help me here

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. Now we have to guess and type, guess and type, etc. because of your bad manners. 
    CREATE TABLE Base_Env
    (base_env_id CHAR(10) NOT NULL PRIMARY KEY,
    Think about the name Base_Data; do you have lots of tables without data? Silly, unh? 
    CREATE TABLE Base_Data
    (base_data_id CHAR(10) NOT NULL PRIMARY KEY,
    Your Links table is wrong in concept and implementation. The term “link” refers to a pointer chain structure used in network databases and makes no sense in RDBMS. There is no generic, magic, universal “id” in RDBMS! People that do this are called “id-iots”
    in SQL slang. 
    We can model a particular relationship in a table by referencing the keys in other tables. But we need to know if the relationship is 1:1, 1:m, or n:m. This is the membership of the relationship. Your narrative implies this: 
    CREATE TABLE Links
    (base_env_id CHAR(10) NOT NULL UNIQUE
       REFERENCES Base_Env (base_env_id),
     base_data_id CHAR(10) NOT NULL
       REFERENCES Base_Data (base_data_id));
    >> The base_env_id is unique in the table where as base_data_id can be repeated I.e multiple rows of Base_Env Table can point [sic] to same Base_Data table row. <<
    Again, RDBMS has no pointers! We have referenced an referencing tables. This is a fundamental concept. 
    That narrative you posted has no ON clauses! And the narrative is also wrong. There is no generic “name”, etc. What tables were used in your non-query? Replace the ?? in this skeleton: 
    SELECT ??.something_name, ??.sync_name, ??.something_version, 
           ??.ppo, ??.dom
    FROM Base_Env AS E, Links AS L, Base_Data AS D
    WHERE ?????????;
    >> I want to eliminate the duplicate records [sic], can any one help me here?<<
    Where is the sample data? Where is the results? Please read a book on RDBMS so you can post correct SQL and try again. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • I have a mac book pro and have already downloaded adobe flash player. However when i go to watch a video it says "Block Plug In". But my adobe is already up to date. Can someone help me to fix this so i can watch videos?

    I have a mac book pro and have already downloaded adobe flash player. However when i go to watch a video it says "Blocked Plug In". But my adobe is already up to date. Can someone help me to fix this so i can watch videos?

    If you're sure you've installed the latest version of Flash, take each of the following steps that you haven't already tried. After each step, relaunch Safari and test. For a "missing plug-in" error, start with Step 7. Back up all data before making any changes.
    Step 1
    You might have to log out or reboot before a Flash update takes effect.
    Step 2
    In the Safari preference window, select
    Privacy ▹ Remove All Website Data
    Close the window. Then select
     ▹ System Preferences… ▹ Flash Player ▹ Advanced
    and click Delete All. Close the preference pane.
    Step 3
    If you're only having trouble with YouTube videos, log in to YouTube and load this page. You may see a link with the text "Leave the HTML5 Trial." If so, click that link.
    Step 4
    If you get a warning of a "blocked" or "outdated" plug-in, then from the menu bar select
     ▹ System Preferences… ▹ Flash Player ▹ Advanced
    and click Check Now. Quit and relaunch the browser.
    If the warning persists, triple-click anywhere in the line below on this page to select it:
    /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources
    Right-click or control-click the highlighted text and select
    Services ▹ Open
    from the contextual menu.* A folder should open. Inside it, there should be a file named "XProtect.meta.plist". If that file is missing and you know why it's missing, restore it from a backup or copy it from another Mac running the same version of OS X. Otherwise, reinstall OS X.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination command-C. In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar, paste into the box that opens (command-V). You won't see what you pasted because a line break is included. Press return.
    Step 5
    Open this folder as in Step 4:
    /Library/Internet Plug-Ins
    Delete the following item, or anything with a similar name, if present:
    Flash Player (failing).plugin  
    You may be prompted for your login password.
    Step 6
    Re-download and reinstall Flash. Download it from the domain "get.adobe.com". Don't click a link from any other website, including this one, because you can't trust links. They may be an attempt to trick you into installing malware masquerading as Flash. Type the address into the browser window. Never download a Flash update from anywhere else.
    Step 7
    If you get a "missing plug-in" error, select
    Safari ▹ Preferences... ▹ Security
    from the Safari menu bar and check the box marked
    Allow (or Enable) plug-ins
    Then click the button marked
    Manage Website Settings...
    if present and make sure that the website is not blocked for Flash.
    Step 8
    Select
    Safari ▹ Preferences... ▹ Extensions
    from the Safari menu bar. If any extensions are installed, disable them.

  • F4 help for Date field and Validation

    Hi Friends,
    I am new to BSP programming .I knew getting F4 help in normal ABAP.But i don't know in BSP .
    I want simple steps to get F4 for a field on Page as well as date field .
    and How to valid those entered dates.
    Presently i am using length 10 character variable for DATE without F4 help and No validation.
    I think you guys will help me out.
    Thanks,
    Venkat.O

    Welcome to SDN.
    for F4 help with validation for dates you can use the following code.
    <htmlb:inputField id         = "wf_ad_date"
                                    type       = "date"
                                    showHelp   = "TRUE"
                                    value = "<%= sy-datum  %>"
                                    visible    = "true"
                                    disabled   = "false"
                                    required   = "true"
                                    maxlength  = "10"
                                    size       = "10"
                                    doValidate = "true"
                                    design     = "standard" />
    For other type of fields check out this weblog by Thomas Jung
    <a href="/people/thomas.jung3/blog/2005/08/22/bsp-value-input-help-popups-version-30 Value Input Help Popups Version 3.0</a>
    Regards
    Raja

  • Help to read a table with data source and convert time stamp

    Hi Gurus,
      I have a req and need to write a ABAP prog. As soon as i excute ABAP program it should ask me enter a data source name, then my ABAP prog has excute teh code, in ABAP code i have to read a table with this data source as key, sort time stamp from table and should display the data source and time stamp as output.
    As follows:
    Enter Data Source Name: 
    Then user enters : 2lis_11_vahdr
    Then out put should be "Data source  :"  10-15-2008.
    The time stamp format in table is 20,050,126,031,520 (YYYYMMDDhhmmss). I have to display as 05-26-2005. Any help would be apprciated.
    Thanks,
    Ram

    Hi Jayanthi Babu Peruri,
    I tried to extract YEAR, MONTH, DAY separately and using
    EDIT MASK written it.
    Definitely there will be some STANDARD CONVERSION ROUTINE will be there. But no idea about it.
    DATA : V_TS      TYPE TIMESTAMP,
           V_TS_T    TYPE CHAR16,
           V_YYYY    TYPE CHAR04,
           V_MM      TYPE CHAR02,
           V_DD      TYPE CHAR02.
    START-OF-SELECTION.
      GET TIME STAMP FIELD V_TS.
      V_TS_T = V_TS.
      CONDENSE V_TS_T.
      V_YYYY = V_TS_T.
      V_MM   = V_TS_T+4(2).
      V_DD   = V_TS_T+6(2).
      V_TS_T(2) = V_MM.
      V_TS_T+2(2) = V_DD.
      V_TS_T+4(4) = V_YYYY.
      SKIP 10.
      WRITE : /10 V_TS," USING EDIT MASK '____-__-________'.
              /10 V_YYYY,
              /10 V_MM,
              /10 V_DD,
              /10 V_TS_T USING EDIT MASK '__-__-__________'.
    If you want DATE alone, just declare the length of V_TS_T as 10.
    Regards,
    R.Nagarajan.
    We can -

  • Having difficulty reading data file and doing analysis, maybe DIAdem can help

    Hello,
    I am new to DIAdem but I think it may be helpful to my application.
    I used Write Labview Measurement File VI with n-signals input to generate a data file containing 2*n columns(time column and data column iteratively). Now I need to do data analysis from the file. I'd tried to use Read Labview Measurement File VI to load the data but didn't work. I found that it can only read file with one signal as input and without file header. But why?
    What I want to do is to extract specific columns from the file. Some column has special flag values which divide the column into sections. I also need to extract these sections from the column and plot each of them. I know this can be easily done on other data analysis software but is there any way I can do it on Labview? Can DIAdem help with this?
    Thank you

    Hello,
    To answer your last question first, DIAdem can certainly help. You can open the TDM file you created with the Write LabVIEW Measurement File VI with DIAdem. If you navigate to the TDM file in the External Data window of DIAdem NAVIGATOR, you can drag and drop the file into the Data Portal and use the channels of data at will.
    You can also right-click on the file in the External Data window and choose Selective Opening…. There is a Help button in the Selective Opening window which will tell you more about using this feature.
    Either way, once your data is in the Data Portal, you can use the DIAdem ANALYSIS to perform a wide range of analysis on your data. For more on the capabilities of DIAdem, I recommend starting at NI DIAdem.
    Now, in regards to using the LabVIEW to access the data in your TDM file, this is also possible. If you are using LabVIEW 7.1, you will want to look at the Read Channel Groups example. This example uses a sequence of VIs from the Functions>>All Functions>>FileI/O>>Storage palette. The example demonstrates reading multiple channels from a TDM file.
    Regards,
    Eric M

Maybe you are looking for

  • Client Agent installation on SCCM Primary Site Server

    Hello, I Installed Client agent via Client push to my SCCM Primary Site. Installation was sucessfull (Return code 0 in ccmsetup.log). But in console still the client status shows 'NO'. Is there any difference when installing Client agent on Primary S

  • Create a jar file using the jar tool

    Hello all, can somebody help me with this situation: I use the following comand jar cfm Seti.jar manifest.mf SetiSeti.jar is the name of the file I want to create and Seti is the name of the folder where I have the class files, the manifest file and

  • Does change to Windows XP involve problems with applicatio​n runnig with Labview 6.1?

    Thank you

  • Include XSL file while using API

    Hello, I want to use the include tag to include a XSL Stylesheet to my RTF while using the API If I run the report locally I use: <?import:file:///C:/temp/htmlmarkup.xsl?> If I run the report on APPS I use: <?import:xdo://INV.HTMLMARKUP.de.DE?> But w

  • Producer/ Consumer Design error?

    I am learning labview as I go and little errors keep stumping me. I set up the producer/consumer design and it reads the two while loops like I want. However, when I stop the program to save it to the write to measure it gives me an error saying inva