How to get the previous record value in the current record plz help me...

In my sql how to get the previous record value...
in table i m having the field called Date i want find the difference b/w 2nd record date value with first record date... plz any one help me to know this i m waiting for ur reply....
Thanx in Advance
with regards
kotresh

First of this not hte mysql or database forum so don;t repeate again.
to get diff between two date in mysql use date_format() to convert them to date if they r not date type
then use - (minus)to get diff.

Similar Messages

  • How to get ridd of Garbage Values in the row from the Tables

    Hi Experts,
    I have an excel Sheet which has a value as
    Name
    ABC
    PQR
    XYZ
    MNO
    STU
    DEF
    JKL
    So i converted that to a csv (Comma de-limited) file and created an external table out off it.
    So when i try to match to "select * from table;" it displys the vlaue as below
    *"ABC*
    however, it should have been just ABC.
    select length(Name) from Table;
    O/p: 4 (It Should have been 3)
    How to get rid off this garbaje character?
    Please Help!!!!!!!
    Regards,
    Ravi R

    You didn't post CSV file. I can't reproduce your issue using the following CSV:
    "ABC"
    "PQR"
    "XYZ"
    "MNO"
    "STU"
    "DEF"
    "JKL"
    SQL> CREATE TABLE EXT_EMP
      2  (
      3  EMP_L VARCHAR2(255)
      4  )
      5  ORGANIZATION EXTERNAL
      6  ( TYPE ORACLE_LOADER
      7  DEFAULT DIRECTORY "TEMP"
      8  ACCESS PARAMETERS
      9  ( RECORDS DELIMITED BY NEWLINE
    10  CHARACTERSET WE8MSWIN1252
    11  STRING SIZES ARE IN BYTES
    12  BADFILE "EXT_EMP.BAD"
    13  NODISCARDFILE
    14  LOGFILE "EXT_EMP.LOG"
    15  SKIP 1 FIELDS TERMINATED BY ','
    16  OPTIONALLY ENCLOSED BY '"' AND '"'
    17  NOTRIM
    18  (
    19  EMP_L CHAR
    20  )
    21  )
    22  LOCATION
    23  (
    24  'Employess.csv'
    25  )
    26  )
    27  REJECT LIMIT UNLIMITED;
    Table created.
    SQL> SELECT  *
      2    FROM  EXT_EMP
      3  /
    EMP_L
    PQR
    XYZ
    MNO
    STU
    DEF
    JKL
    6 rows selected.
    SQL> SY.

  • How to get rid of unassigned values in the report

    hai to all,
    here is the issue,
       while running a report(sales per country), iam getting the data,after that when i drill down on <u><b>sales document number</b></u> iam getting some unassigned data, with Sales document number as #, and some value in the keyfigure.what is the reason behind this?
    Here is another issue that i want to find all the sales documents which have the value # in the report?, is it possible?    the same case with <u><b>Customer country</b></u>, on the same report.
    pl anyone help me
    br
    venkat/shyam

    Hi Shyam.
    Regarding the first issue: Well, you've loaded some data records into your cube where the "Sales Doc Field" is empty.  Did you load through PSA? The best way to scan your PSA (I believe) is to find the underlying table and have a look at it via SE16. In this way you don't have to  scan through every data single package. This can be done via "display data flow" from your cube and switch on technical names. There you have it. (It's called /BIC/B00...etcetc you might have to add i few zeroes though when you enter it into SE16). Get request ID from "Infocube Managment". In SE16 seelction screen use F2 to set the "sales Doc No." field even to blank.
    Second issue is a bit easier: in your query (or a working copy of your query) restrict on "Sales Doc No" or "Customer Coutry" to only include value "#". In the same way you can remove the unassigned values be excluding value "#".
    Hope this works for you.
    Chears, Jørn

  • How to get and disply dynamic values on the fly and display in applet

    hello all ,
    i have a problem in refreshing a applet.
    i have a scrolling applet which will get the share values from the database and display in a scrolling applet in the browser . i am getting the values and displaying it.
    but the problem is , if i enter a new record in the database, until and unless i press refresh button of the browser, i am not getting the new values . please help me if anybody having the idea. please mail me to [email protected]
    thank you all.
    by
    samba

    You want a database update to trigger an applet refresh? Can't be done.
    However, you can have the applet periodically re-query the database and update its display with the information it retrieves. Just kick off a Thread that sleeps for a bit, wakes up, queries the db, updates the display, and goes back to sleep.

  • How to get a custom style value in the interaction manager's getCommonCharacterFormat() function ?

    Hi,
    I have a scenario where I have applied Css styles to the textflow using the IFormatResolver interface.
    Now what I need is a way  to show which style is applied to the current selection.
    I am getting all infomation using the following however the style name that is associated is not there.
    var textLayoutFormat:TextLayoutFormat = textFlow.interactionManager.getCommonCharacterFormat() as TextLayoutFormat;
    in my case I am having a parameter myStyle in the usersstyle object of the actual flow elements, but when I do the above I find that the user style object is different and it doesnt have any parameters as mystyle under it
    -Ashar

    There's no general code for that.  You will have to write something on your own.  If for example you want to check for a specific style having a common value across the range a new function modeled on getCommonCharacterFormat would work:
        public static function getCommonCharacterStyle(range:ElementRange,styleName:String):*
            var leaf:FlowLeafElement = range.firstLeaf;
            var value:* = leaf.getStyle(styleName);
            if (value === undefined)
                return undefined;    // no common value or common value is undefined
            for (;;)
                if (leaf == range.lastLeaf)
                    break;
                leaf = leaf.getNextLeaf();
                if (value !== leaf.getStyle(styleName))
                    return undefined;    // no common value
            return value;     // common value
    Depending on your use case some variation of this will supply the information your application needs.  More complicated, but doable, would be extending this to work on all userStyles in leaf returning an object of key-value pairs.
    Hope that helps,
    Richard

  • How to get Implicit Dimensions/Dimension Values in the result set?

    Hi All,
    How does endeca return implicitly selected dimensions in the result set? For example, consider a dimension set up for Television data as below.
    Brand
    Samsung
    LG
    Philips
    Type
    LEDs
    LCDs
    Plasma
    Lets say, I refine the result set by brand, by selecting Philips. Now lets assume that there were 2 results returned for philips and both the results were of Type - Plasma. In this case, Endeca does not return the Type dimension in the result set, as we cannot drill down the 2 results further based on LED or LCD.
    How does Endeca return these implicit dimensions in the result set in such scenarios? Suppose if there was a requirement to show to the user that both the results were of Type - Plasma, how do we get this information from Endeca, by default?
    Thanks in advance :)

    How does Endeca return these implicit dimensions in the result set in such scenarios?Check out: Navigation.getCompleteDimensions() or Navigation.getCompleteDimGroups()
    http://docs.oracle.com/cd/E28910_01/PresentationAPI.622/apidoc/javadoc/navigation/index.html

  • How to get a Previously purchased app  from the App Store from a different account on the same computer?

    Recently had to replace my hard drive and some info has gone missing.  An App from the App Store for one.  How can I get it back now that I have a new account?  It wont let me sign on with the old one anymore.

    There's no need to create a new Apple ID just because the hard drive was replaced.
    Apps can only be re downloaded using the same Apple ID they were purchased with originally.
    You will have to re purchase the app using the new Apple ID.

  • How to get an Net asset value for the Equipment from ERP in to BI

    Hi
    I am extracting the data from CRM to BI about the De installation information like
    Planned date of de installation, contract end date etc . But Ineed to extract Asset net value for that equipement. I think asset value should be extracyed from ERP but I dont know which tables and datsource stores
    Thanks,
    Sudha

    If you want the main tables within Assets :
    FI-AA-AA (AA)    Asset Accounting: Basic Functions u2013 Master Data
    ANKA             Asset Classes: General Data             ANLKL
    ANKP             Asset Classes: Fld Cont Dpndnt on Chart ANLKL / AFAPL
                     of Depreciation
    ANKT             Asset Classes: Description              SPRAS / ANLKL
    ANKV             Asset Classes: Insurance Types          ANLKL / VRSLFD
    ANLA             Asset Master Record Segment             BUKRS / ANLN1 / ANLN2
    ANLB             Depreciation Terms                      BUKRS / ANLN1 / ANLN2 / AFABE
                                                             / BDATU
    ANLT             Asset Texts                             SPRAS / BUKRS / ANLN1 / ANLN2
    ANLU             Asset Master Record User Fields         .INCLUDE /  BUKRS / ANLN1 /  ANLN2
    ANLW             Insurable Values (Year Dependent)       BUKRS / ANLN1 / ANLN2 / VRSLFD /
                                                             GJAHR
    ANLX             Asset Master Record Segment             BUKRS / ANLN1 / ANLN2
    ANLZ             Time Dependent Asset Allocations        BUKRS / ANLN1 / ANLN2 / BDATU
    FI-AA-AA (AA2)   Asset Accounting: Basic Functions u2013 Master Data 2.0
    ANAR             Asset Types                             ANLAR
    ANAT             Asset Type Text                         SPRAS / ANLAR
    FI-AA-AA (AB)    Asset Accounting: Basic Functions u2013
                     Asset Accounting
    ANEK             Document Header Asset Posting           BUKRS / ANLN1 / ANLN2 / GJAHR /
                                                             LNRAN
    ANEP             Asset Line Items                        BUKRS / ANLN1 / ANLN2 / GJAHR /
                                                             LNRAN / AFABE
    ANEV             Asset Downpymt Settlement               BUKRS / ANLN1 / ANLN2 / GJAHR /
                                                             LNRANS
    ANKB             Asset Class: Depreciation Area          ANLKL / AFAPL / AFABE / BDATU
    ANLC             Asset value Fields                      BUKRS / ANLN1 / ANLN2 / GJAHR /
                                                             AFABE
    ANLH             Main Asset Number                       BUKRS / ANLN1
    ANLP             Asset Periodic Values                   BUKRS / GJAHR / PERAF / AFBNR /
                                                             ANLN1 / ANLN2 / AFABER
    FI-SL-VSR (GVAL) Special Purpose Ledger: Validation, Substitution and Rules
    GB03             Validation / Substitution User          VALUSER
    GB92             Substitutions                           SUBSTID
    GB93             Validation                              VALID

  • How to get column names as value in the target table ?

    Hello All,
    I want your help to solve my problem. Any suggestions are welcomed.
    Problem - I have source data in Microsoft Excel in following format,
    Ids q12 q13 q14
    10001 1 1 2
    10002 2 4 1
    In my target table , which is in Oracle i want data in following format,
    IDs Question Answer
    10001 q12 1
    10001 q13 1
    10001 q14 2
    10002 q12 2
    10002 q13 4
    10002 q14 1
    In table i have q12, q13, q14 as column names, Now i want to fill q12, q13,
    q14 as values of one of the column ( Question ) in my target table.
    Note - I don't want to hard code the values ... is there any way i achieve this?
    Thanks in Advance.
    AC

    1. Create a staging table with 4 columns. Ids,q12,q13 and q14
    2. Create a main table in the format you want ie., Ids, question and answer
    3. Load the Excel after converting into CSV using SQLLDR into the staging table.
    4. Then move the data from staging to main as below
    insert into main(ids,question,answer)
    (select ids,'q12',q12 from table1
    union all
    select ids,'q13',q13 from table1
    union all
    select ids,'q14',q14 from table1)There might be someother easier way to achieve this. But i dont think you can use SQLLDR to load the data denormalized like you have mentioned. But you can write a procedure which reads the file using UTL_FILE and insert into the table.
    Message was edited by:
    Mohana Kumari

  • I was given an ifone 5s that was purchased 3rd hand with an apple id.. I have no idea who the previous owner was.. Can anyone plz help with that issue?? I want to delete the apple id and create a new one????

    HOw can i delete the apple ID that came on a iphone 5s that was purchased 3rd hand and given as a gift to me... Thank you very much for your time and assistance in this mAtter..

    You can’t, and Apple won’t do it for you; the activation lock is an anti-theft measure. Try getting a refund for it.
    (123834)

  • How to get a component's value inside a repeater using the component's id?

    Hello I'm using a repeater with an httpservice as dataprovider.
    in this repeater, I have a <mx:Panel> containing a <mx:Text>, a <mx:ButtonBar>, and a <mx:HSlider>.
    I need to get the text property of the Text component and the HSlider's value when the slider's value changed. (using the "change=..." property of my HSlider).
    How to do this as I have to know which Panel, HSlider, and which Text has been activated by the slider change?
    Thanks for your help

    This might help you.
    <?xml version="1.0"?>
    <!-- repeater\GetItem.mxml -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
             import mx.controls.Alert;
           [Bindable]
           public var myAC:Array=[1,2,3,4];
           public function getData(event:Event):void{
                     Alert.show(event.currentTarget.text);
                     Alert.show(mySlider[event.target.repeaterIndices].value);
        ]]>
      </mx:Script>
      <mx:Repeater id="myrep" dataProvider="{myAC}">
          <mx:TextInput change="getData(event);" />
          <mx:HSlider id="mySlider" maximum="200" minimum="50" value="67"  snapInterval="1"/>
      </mx:Repeater>
    </mx:Application>

  • How to get a list of values used in the WHERE filter of stored procedures and functions in SQL Server

    How can I get a list of values (one or more) used in the WHERE filter of stored procedures and functions in SQL Server?
    How can get a list of values as shown (highlighted) in the sample stored procedure below?
    ALTER PROC [dbo].[sp_LoanInfo_Data_Extract] AS
    SELECT   [LOAN_ACCT].PROD_DT,
                  [LOAN_ACCT].ACCT_NBR, 
                  [LOAN_NOTE2].OFCR_CD, 
                  [LOAN_NOTE1].CURR_PRIN_BAL_AMT, 
                  [LOAN_NOTE2].BR_NBR,
    INTO #Table1
    FROM
                    dbo.[LOAN_NOTE1],
                    dbo.[LOAN_NOTE2],
                    dbo.[LOAN_ACCT]
    WHERE
                    [LOAN_ACCT].PROD_DT = [LOAN_NOTE1].PROD_DT
                    and
                    [LOAN_ACCT].ACCT_NBR = [LOAN_NOTE1].ACCT_NBR
                    and
                    [LOAN_NOTE1].PROD_DT = [LOAN_NOTE2].PROD_DT
                    and
                    [LOAN_NOTE1].MSTR_ACCT_NBR = [LOAN_NOTE2].MSTR_ACCT_NBR
                    and
                    [LOAN_ACCT].PROD_DT = '2015-03-10'
                    and
                    [LOAN_ACCT].ACCT_STAT_CD IN
    ('A','D')
                    and
                    [LOAN_NOTE2].LOAN_STAT_CD IN
    ('J','Z')
    Lenfinkel

    Hi LenFinkel,
    May I know what is purpose of this requirement, as olaf said,you may parse the T-SQL code (or the execution plan), which is not that easy.
    I have noticed that the condition values in your Stored Procedure(SP) are hard coded and among them there is a date values, I believe some day you may have to alter the SP when the date expires. So why not declare 3 parameters of the SP instead hard coding?
    For multiple values paramter you can use a
    table-valued parameter. Then there's no problem getting the values.
    If you could elaborate your purpose, we may help to find better workaround.
    Eric Zhang
    TechNet Community Support

  • How to get the User entered value in the Submit request form for a parameter of a concurrent program in Oracle applications.

    Hi All,
    I have a requirement where i need to get the user entered value in the Parameter of a concurrent program while submitting it. i tried to query the FND_CONCURRENT_REQUESTS table but in that it stores the ID values from the value set of the Parameter.
    After submitting the Concurrent request when we click on the view Details button it opens a form where it displays the arguments in the parameter field .  i want to get that string.
    Thanks a lot in advance for your time and help.
    - Vijay

    Hi All,
    I have a requirement where i need to get the user entered value in the Parameter of a concurrent program while submitting it. i tried to query the FND_CONCURRENT_REQUESTS table but in that it stores the ID values from the value set of the Parameter.
    After submitting the Concurrent request when we click on the view Details button it opens a form where it displays the arguments in the parameter field .  i want to get that string.
    Thanks a lot in advance for your time and help.
    - Vijay

  • How to get all previous versions page contents of a publishing page using SharePoint Client Object Model 2010

    How to get all previous versions page contents and other field values of a publishing page using SharePoint Client Object Model 2010?
    Thanks,
    Osmita

    Hi Osmita,
    Greetings.
    Here are the links that helps you. It has code attached to it.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/a0d2ab40-99ba-4368-8505-1dc559ef6469/get-content-of-previous-version-of-page-sharepoint-2010?forum=sharepointgeneralprevious
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/faaf419f-997e-4150-9911-48cc375c3b46/how-to-get-previous-published-versions-of-publishing-pages-in-sharepoint-2010?forum=sharepointdevelopmentprevious
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Getting the last selected value of the combo  - very very urgent...........

    On my panel i have a jcombobox in upper half(which displays say the address type.) and few text fields on the lower half(which displays the add details). when the user selects a value in the combo box the text fields are populated based on the selection. The user can change the values displayed in the text fields. So before setting the new values in the text fields the last displayed values need to be saved.
    I have an ActionListener for my combo which gives me the currently selected value by calling getSelecetdItem()
    How can i get the last selcted value of the combobox without using any variable of my own.

    To update the last displayed details(the address details say) i need to check what type of address the combo had previousely.....
    when i display the panel first time the home address is set by default and i have a variable to hold this value..as the user changes the selection i update the variable...I don't want to use this variable..instead if i can get the last selcted value from the event that would be great...
    thanks

  • How to use the same column value in the casecadeing parameter in ssrs report?

    Hi frnz,
    I have a table site contains one filed SiteCode
    Now i have fields like below using the below quries 
    SThe above are the two results sets coming from the single table ,now i will use these two results /Query in my ssrs Casecade report
    1.First result set/Query will use for the first dataset and use these values in the paramet1 selection as PrimaryCodes
    2.Second result set/Query will use for the second Dataset and use these values in the parameter2 as SecondayCodes
    3.Using these two datsets and create a Casecadeing paramet in ssrs report.
    4.so using this information how can i create the Casecade report ,I have tried different ways but i didnt get the soluction
    I have done the follw but ididnt get the o/p.
    I have created two parameter and mapped to the results but while paramter selection i will able to see only the first paramet(PrimaryCodes) ,and i will not see the second paramter(SecondaryCodes) it could not show me the second paramter values in the drop
    down list.
    Note:Here i will use the Single Table to get the all the sitecodes 
    Can some one please help me out for this report.
    Thanks.

    Hi,
    Try below links for your reference:
    http://blogs.msdn.com/b/sqlforum/archive/2011/05/26/ssrs-cascading-parameter-with-optional-select-all-in-sql-reporting-services-report.aspx
    http://msdn.microsoft.com/en-us/library/dd255197.aspx
    http://blogs.msdn.com/b/psssql/archive/2010/01/29/how-to-have-a-select-all-multi-value-cascading-parameter.aspx
    sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.

Maybe you are looking for

  • In Badi -- In Methods --- Parameters

    Hi All, I have badi in Header there is a method and having  parameters I_MKPF TYPE MKPF HEAD TYPE J_3RM4_HEAD J_3RM4_HEAD structure contains these fields      MBLNR OKPO NOTICE BUKRS BUDAT LAND1 CC_NAME SUBDIV BWART LGORT LGOBE MBLNR NOTICE BUKRS SUP

  • Ways to make up for lost time...

    Since the release of 2.0 I find myself spending so much time backing up/syncing. "What used to take two minutes now takes all day..."-sh God forbid a I add an App from the iP itself and then sync that.... Anyway, since there are only so many hours in

  • Exception With JEditorPane

    For some reason I sometimes get an exception when displaying an HTML page in a JEditorPane. Heres the exception: java.lang.ArrayIndexOutOfBoundsException: 0         at javax.swing.text.html.BlockView.layoutMinorAxis(BlockView.java:244)         at jav

  • Login form Blank

    Hello everyone, I have created a Basic Login form in DWCS3 and what i am getting is a blank page with no user name password box just blank page.

  • Why is my mac so slow after iCloud/lion?

    my macbook pro doesn't respond with the agility that it did before i switched to icloud/lion. it's very annoying. i have to restart it often. when i plug in my iphone it takes a while to synch if it does at all. what to do? thanks for your help!