Compare previous with Current Value

Want to compare previous with current value and assign the right one..
COLA COLB
72 21356
41023 21356
90 78903
90 89078
90 78956
90 45632
41023 78903
41023 45632
Output I want is:
COLA COLB
72 21356
72 21356
90 78903
90 89078
90 78956
90 45632
90 78903
90 45632
Anytime the value in COLA is 41023, I need to look at value in COLB and compare it with the rest of values and assign the COLA value that is NOT 41023
Thanks...

Not sure but here a try :
SQL> select * from tbltbl;
      COLA       COLB
        72      21356
     41023      21356
        90      78903
        90      89078
        90      78956
        90      45632
     41023      78903
     41023      45632
8 rows selected.
SQL> MERGE INTO tbltbl a
  2  USING (select c.cola,b.rowid rwd
  3         from   tbltbl b,
  4                tbltbl c
  5         where  b.cola=41023
  6         and    b.colb=c.colb
  7         and    c.cola!=41023) d
  8  on    (a.rowid=d.rwd)
  9  WHEN MATCHED THEN UPDATE set a.cola=d.cola;
3 rows merged.
SQL>
SQL> select * from tbltbl;
      COLA       COLB
        72      21356
        72      21356
        90      78903
        90      89078
        90      78956
        90      45632
        90      78903
        90      45632
8 rows selected.Works only if colb is unique for non 41023 value.
Nicolas.
Oh, very very late.
Edited by: N. Gasparotto on Oct 3, 2008 5:05 PM

Similar Messages

  • Compare few columns current value with previous version within a table

    I have a table that stores version information. Everytime there is a change in one field, a new version is created. I need to get the last value and the current value (after the update). There might be around 12 columns that I need to check for any updates.
    How may I achieve this?
    Any help greatly appreciated.
    Thx!

    Perhaps you're looking for something like
    SELECT col1, col2, col3, ... colN
      FROM (
        SELECT col1, col2, col3, ... , colN, RANK() OVER (ORDER BY update_date DESC) rnk
          FROM your_table
    WHERE rnk <= 2It would be very helpful in general, if you could provide DDL
    SCOTT @ jcave102 Local> create table a (
      2  version number,
      3  create_time timestamp,
      4  col1 number,
      5  col2 number,
      6  col3 number
      7  );
    Table created.
    Elapsed: 00:00:00.06scripts to insert the data
    SCOTT @ jcave102 Local> insert into a values( 1, systimestamp - interval '3' hour, 10, 10, 10 );
    1 row created.
    Elapsed: 00:00:00.04
    SCOTT @ jcave102 Local> insert into a values( 2, systimestamp - interval '2' hour, 10, 9, 9 );
    1 row created.
    Elapsed: 00:00:00.01
    SCOTT @ jcave102 Local> insert into a values( 3, systimestamp, 8, 9, 9 );
    1 row created.
    Elapsed: 00:00:00.01
    SCOTT @ jcave102 Local> commit;
    Commit complete.
    Elapsed: 00:00:00.00And a description of exactly what you want the results to look like given that data,
       VERSION       COL1       COL2       COL3
             3          8          9          9
             2         10          9          9If we have those things, it's relatively easy for us to follow exactly what question you're asking and to write a query that generates the expected output, i.e.
      1  select version, col1, col2, col3
      2  from( select version, col1, col2, col3, rank() over (order by create_time desc) rnk
      3          from a )
      4* where rnk <= 2
    SCOTT @ jcave102 Local> /
       VERSION       COL1       COL2       COL3
             3          8          9          9
             2         10          9          9
    Elapsed: 00:00:00.01Otherwise, we have to guess at exactly what you're trying to get and we'll almost always guess incorrectly a couple of times.
    Justin

  • Compare Hiredate with Current date in PCR

    As per the requirement I have, a certain type of accrual needs to occur on the employee's anniversary date, this accrual should only happen on the first anniversary. How can I compare hire date with current date ignoring the year, and then ignoring the same logic from second year on-wards.
    Can someone please help me with the possible method of implementing this requirement in a time PCR.

    In my humble opinion, I think that you should achieve that by means of an ABAP program, it should be scheduled to run every day and compare the hiring date with the current date of every employee, then create a batch input to Infotype 2013... it would be easier to track and monitor, since you would have all logs in SM35
    Best regards,
    Federico.

  • How to Compare date with Current system date in XSLT mapping.

    Hello Experts
    In a XSLT mapping program, I hava a filed, ZZOB which is giving some date.
    which I need to compare with the current date.
    Condition-
    ZZOB is greater than current date or ZZOBLIG = NULL
    Then go further statements.
    how can i campare with the current date?
    Please help.
    Thanks
    Balaprasad

    This example may help:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:param name="currentDate"/>
        <xsl:variable name="firstDate" select="concat(substring($currentDate, 1,4),substring($currentDate, 6,2),substring($currentDate, 9,2))"/>
        <xsl:template match="/">
            <xsl:apply-templates select="//item"/>
        </xsl:template>
        <xsl:template match="item">
            <xsl:variable name="secondDate" select="concat(substring(submissionDeadline, 1,4),substring(submissionDeadline, 6,2),substring(submissionDeadline, 9,2))"/>
            <xsl:choose>
            <xsl:when test="$firstDate &gt; $secondDate">
                <xsl:call-template name="late"/>
                </xsl:when>
                <xsl:when test="$firstDate &lt; $secondDate">
                    <xsl:call-template name="ontime"/>
                </xsl:when>
                <xsl:when test="$firstDate = $secondDate">
                    <xsl:call-template name="same"/>
                </xsl:when>
                <xsl:otherwise>Monkeys<br /></xsl:otherwise>
            </xsl:choose>
        </xsl:template>
        <xsl:template name="ontime">
            This is on time
        </xsl:template>
        <xsl:template name="late">
            This is late
        </xsl:template>
        <xsl:template name="same">
            This is on time
        </xsl:template>
    </xsl:stylesheet>

  • How to compare date with null value

    Hi
    I have a date filed and i assigned that input box with context attribute of type Date.
    Here my problem is
    when the end user not entered any thing (null ) the i have give some defaul date.
    so first in the action method i have to check the date with null
    if it is null i have to give default date.
    so please let me know how to over come this.
    thanks
    Mukesh

    Hi
    You can get your date in your action method like
    Date newDate=new Date();
    Date myDate= wdThis
                              .wdGetYourComponentNameController()
                                      .wdGetContext()
                                           .currentYourNodeNameElement()
                                                           .getYourDateName();
    if ( myDate== null) {
             wdContext.currentContextElement().setYourDateName(newDate);
    else{...........//continue your other validations or calling other methods}
    Regards
    Abhijith YS
    Message was edited by:
            Abhijith YS

  • What are Current Value Tables VIs in LabVIEW 2010?

    I was just looking over LabVIEW 2010, and noticed a new set of VIs stored under "Reference Design".  They seem to consist of a series of VIs dealing with Current Value Tables.  What are these?  I tried to search Help, didn't find much under either CVT or Reference Design.  There's a discussion of Reference Design in the NI Tutorials, but it doesn't really seem to apply ...

    Hello Bob,
    Reference Designs are essentially application oriented examples made by NI systems engineers. These examples demonstrates how to design and integrate systems rather than NI Shipping Examples that illustrate features of products.
    You can find more information about Reference Designs here
    An Overview of Reference Designs
    http://zone.ni.com/devzone/cda/tut/p/id/8241#toc0
    Andy Chang
    National Instruments
    LabVIEW Control Design and Simulation

  • Compare the current value with the previous value in the same column

    Hi all,
    I have to include a statement in a query which allows to compare the current value of column A with the previous value of column A (same column). from there, I need to add a condition in order to have the expected result.
    Let's take an example to illustrate what I want to achieve:
    I have the following columns in table called 'Charges':
    Ship_id batch_nr Order_nr Price
    SID1111 9997 MD5551 50
    SID1111 9998 MD5552 50
    SID1111 9999 MD5553 50
    SID2222 8887 MD6661 80
    SID2222 8887 MD6662 80
    SID2222 8887 MD6662 80
    SID3333 6666 MD7771 90
    I want to check if the ship_id of row 2,3 (and more if available) is equal to the ship_id of row 1.
    If it is the case, then value 'together with the first batch_nr' in row 2 and 3 under Price column. If not, then keep the original value of Price column
    PLease see below the expected result:
    Ship_id batch_nr Order_nr Price
    SID1111 9997 MD5551 50
    SID1111 9998 MD5552 together with 9997
    SID1111 9999 MD5553 together with 9997
    SID2222 8887 MD6661 80
    SID2222 8887 MD6662 together with 8887
    SID2222 8887 MD6663 together with 8887
    SID3333 6666 MD7771 90
    Thanks in advance for your help, it is really urgent.
    Imco20030

    Hi,
    user11961002 wrote:
    Hi,
    Here is the query that I use:
    [ select
    sl.ship_id,
    o.ordnum,
    o.reffld_5 "BatchNR",
    sum(tc1.chrg_amt) "FreightPRC",
    sum(tc2.chrg_amt) "FuelPRC",
    sum (tc1.chrg_amt + tc2.chrg_amt + tc3.chrg_amt) "Total Price"
    from ord_line ol
    join ord o on (ol.ordnum = o.ordnum and ol.client_id = o.client_id)
    join shipment_line sl on (ol.ordnum = sl.ordnum and ol.client_id = sl.client_id and ol.ordlin = sl.ordlin)
    join adrmst a2 on (o.rt_adr_id = a2.adr_id)
    left join tm_chrg tc1 on (tc1.chargetype = 'FREIGHT' and tc1.chrg_role = 'PRICE' and tc1.ship_id = sl.ship_id)
    left join tm_chrg tc2 on (tc2.chargetype = 'FUELSURCHARGE'and tc2.chrg_role = 'PRICE' and tc2.ship_id = sl.ship_id)
    where sl.ship_id = 'SID0132408'
    group by o.client_id, o.ordnum, o.reffld_2, sl.ship_id, a2.adrnam, a2.adrln1, a2.adrpsz, a2.adrcty, a2.ctry_name,
    o.reffld_5, ol.early_shpdte
    order by ship_id
    ]That looks like the query you were using before you started this thread.
    Modify it, using the analytic fucntions FIRST_VALUE and LAG, like I showed you.
    I see that you did simplify the problem quite a bit, and it's good that you did that.
    It doesn't matter that your real problem involves joins or GROUP BY. Analytic functions are calculated on the results after all joins and GROUPS BYs are done. Just substitute your real expressions for the simplified ones.
    For example, in your simplified problem, there was a column called order_nr, but I see now that's it's really called o.ordnum. Where the solution I posted earlier says "ORDER BY order_nr", you should say "ORDER BY o.ordnum".
    Here's a less obvious example: in your simplifed problem, there was a column called price, but I see now that it's really SUM (tc1.chrg_amt + tc2.chrg_amt + tc3.chrg_amt). Where the solution I posted earlier says "TO_CHAR (price)", you should say "TO_CHAR (SUM (tc1.chrg_amt + tc2.chrg_amt + tc3.chrg_amt))". (You can't use an alias, like "Total Price", in the same SELECT clasue where it is defined.)
    I removed some columns from the select as they are not relevant for the wanted action like 'adress details or other references'.
    Now here is the result:
    Shipment ID     Order Number     WMS Batch     Freight      Fuel Price Order Total Price
    SID0132408     MDK-000014-05602649     04641401     110     10 120
    SID0132408     MDK-000014-05602651     04641402     110     10 120
    SID0132408     MDK-000014-05602652     04641363     110     10 120
    as you can see, the 3 orders have the same shipment ID.
    The expected result should be shown under column 'Total Price' as follows:
    Shipment ID     Order Number     WMS Batch     Freight      Fuel Price Order Total Price
    SID0132408     MDK-000014-05602649     04641401     110     10 120
    SID0132408     MDK-000014-05602651     04641402     110     10 tog with 04641401
    SID0132408     MDK-000014-05602652     04641363     110     10 tog with 04641401Okay, so those are the correct results that I asked for, plus the incorrect results you're getting now. Thanks; extra information doesn't hurt.
    But where is the raw data that you're starting with?
    It looks like you tried to format the code (but not the results) by typing this 1 character:
    before the formatted section and this different character
    after the formatted section. To post formatted text on this site, type these 6 characters
    before the formatted section, and the exact same 6 characters again after the formatted section.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Compare current value with previous value

    Hello,
    I would like to compare the current value with the previous value of the current value.
    How can I solve this problem?
    Maurits

    Hi,
    after going through the basics course you surely can understand that example:
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Comparing the current value with the previous one in Powershell

    Hi,
    New to scripting and i was wondering how can I compare the current value with the previous value?
    I am having trouble with the loop structure, and I am not sure I am on the right track...
    I am trying to compare the record to next record in the same csv file after import-csv... My code runs fine, but is not giving the right result.
    $FilePath = Get-FileName -initialDirectory "C:\"
    #Testing for null
    If($FilePath)
    $Data = Import-csv -Path $FilePath | Sort-Object BUYER, {[int] $_.PO_NBR}, {[int] $_.LINE_NBR}
    Foreach($fData in $Data)
    $i = $fData
    Foreach($i in $fData)
    if($fData.Buyer -eq $i.Buyer)
    #save all the same buyer name to a new variable
    Write-Host "Same as previous"
    Else
    Write-Host "Variable is null"
    Remove-Item function:\Get-FileName

    Thank you. The Foreach loop is now working properly.
    Can I ask what is the purpose of "-ea 0" in the import-csv? I can't seem to find "-ea" as a parameter for import-csv in help.
    -ea is short for -ErrorAction.
    Don't retire TechNet! -
    (Don't give up yet - 13,225+ strong and growing)

  • How to compare, current value in :block.text_item with the database value

    Hi
    Could you please tell me
    How to compare the current value in :block.text_item with the corresponding database column value.
    I am using forms 10g
    There is block and there is an text Item in that block.
    When I run the form and query the block (tabular), the :block.text_item shows me, whatever value there in the database.
    Now I add some value in the :block.text_item to the existing value.
    now
    the :block.text_item contains old+ new added value
    whereas
    the database table contains 'old' value
    Now on a button click , I want to find out what is the value that I have added
    Could you please tell me, is it possible without writing a select query?

    Hello,
    Now on a button click , I want to find out what is the value that I have addedSo you mean always user will add value in the existing value. Because this way will fail in one case. Let say
    Value in Database is = ABCD
    User opened the form and he removed the D and write E and now value is ABCE and length is still same 4. So, there is no addition.
    Anyway you can know the database value at runtime there is one property for item called DATABASE_VALUE. It gives the value which is in database while you are running the form before save. and you can use like this..
    Trigger = WHEN-MOUSE-DOUBLE-CLICK on item level
    DECLARE
      vItemValue DATATYPE; -- Set the data type according to your desired field.
      vValueAdded DATATYPE; -- Set the data type according to your desired field.
    BEGIN
      vItemValue:=GET_ITEM_PROPERTY('ITEM_NAME',DATABASE_VALUE);  -- It will return you the database value in vItemValue variable.
      IF LENGTH(vItemValue)>LENGTH(:FORM_ITEM_NAME) THEN  -- It mean something change or added
        vValueAdded:=SUBSTR(:FORM_ITEM_NAME,LENGTH(vItemValue)+1);
        MESSAGE('Added value is : '||vValueAdded);  -- It will show you the added value.
      END IF;
      -- now suppose you want to show the old and new value in message not the added one
      -- Then no need of IF condition. You can just use message like this
      -- And i would prefer to use like this way
      MESSAGE('Old Value : '||vItemValue||'  New Value - '||:FORM_ITEM_NAME);
      MESSAGE('Old Value : '||vItemValue||'  New Value - '||:FORM_ITEM_NAME);
    END;Hope it is clear.
    -Ammad

  • Unable to get values within scope of the RowGroup(only got values using Previous and current scope value)

    Hi All,
    I already calculated a row(Add Total row) like  Gross profit within Group1 (a,b,c,d,e which are sub groups) using Previous and current scope column group values. ex: Gross Profit = a - b. (within group1)
    Gross Profit = Previous(Sum(Fields!Trans_amount.Value)) - Sum(Fields!Trans_amount.Value) in Group1
    Now, I want to get values for Net income like  Net income = a - b - c in Group1.  (OR)
    Net income = Gross  Profit - c in Group1 (Using Gross Profit textbox values using Reportitems!textbox.value). but, values different.  Since Expression got new calculation)
     Please help me.
    Thanks Advance.
    - Prem Kumar T D http://www.sharepointbasic.com/

    Hi Premtd,
    As per my understanding, there are group and subgroups in the report, you added total to a group with the expresson: Previous(Sum(Fields!Trans_amount.Value)) - Sum(Fields!Trans_amount.Value). You want to add a text box to the report to calculate Net income
    with the expression: Previous(Sum(Fields!Trans_amount.Value)) - Sum(Fields!Trans_amount.Value) - Sum(Fields!Trans_amount.Value). In order to improve the efficiency of troubleshooting, I need to ask several questions:
    • “I already calculated a row(Add Total row) like  Gross profit within Group1 (a,b,c,d,e which are sub groups)” What’s the meaning of Group1 and subgroup a, b, c, d, e ? Could you please mark Gross profit and the groups in the screenshot?
    • How to calculate Net income? Please provide some more detailed information of your requirements. I would be appreciated it if you could provide sample data and clear screenshot of the report.
    This may be a lot of information to ask for at one time. However, by collecting this information now, it will help us move more quickly toward a solution.
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu

  • How to compare a Date data with Current Year and Period Member on FIX

    Hi experts,
    I have a Project dim that each member is a Project (P01, P02...)
    and Account dim that stores information of the each Project (Name, Start date, Finished Date...)
    Finished Date member is in Date data type
    So how can write a IF condition below in order to compare Project Finished Date with Current Year and Period members on FIX
    FIX (@Descendants(Projects), Descendants(All Year), Descendants("Year Total")...)
    IF (@CURRMBR(Period)->@CURRMBR(Year) < Project->FinishedDate)
    Do something...
    Else
    Do something
    Please help me on this. Sorry for my bad grammar. Please ask if there is anything unclear
    Many thanks,
    Huy Van.
    Edited by: Huy Van on Jan 29, 2013 1:14 AM
    Edited by: Huy Van on Jan 29, 2013 2:24 AM
    Edited by: Huy Van on Jan 29, 2013 2:25 AM
    Edited by: Huy Van on Jan 29, 2013 6:04 PM

    Here is what I have done. Post for whom may concern later
    VAR FM; /* Finished Month of Project*/
    VAR FY; /* Finished Year of Project */
    VAR CM; /* Capture Current Month on FIX statments */
    VAR CY; /* Capture Current Year on FIX statments*/
    FIX ( @RELATIVE( "Year", 0), @RELATIVE( "Period", 0), @IDescendants( "Base Projects")....)
    FY = @ROUND( "TGHT"->"NA Contract"->"FY06"->"NA Period" / 10000, 0);
    FM = @MOD( @ROUND( "TGHT"->"NA Contract"->"FY06"->"NA Period" / 100, 0), 100);
    /* For FY13 return 13... */
    CY = @JgetDoubleFromString( @CONCATENATE( "20", @SUBSTRING( @NAME( @CURRMBRRANGE( Year, Lev, 0, 0, 0)), 2)));
    /* Set CM value based on currrent Period On FIX statement */
    IF ( @ISMBR( "Jan"))
    CM = 1;
    ELSEIF ( @ISMBR( "Feb"))
    CM = 2;
    ELSEIF ( @ISMBR( "Dec"))
    CM = 12;
    ENDIF
    IF ( CY < FY OR ( CY == FY AND CM < FM))
    Do something...
    ELSE
    Do something...
    ENDIF
    ENDFIX
    Edited by: Huy Van on Feb 19, 2013 11:10 PM
    Edited by: Huy Van on Feb 20, 2013 7:46 PM

  • BO Webi report hierarchy with measure values showing more(almost double value) compare to BW Bex report

    Hi,
    In our BO Webi report hierarchy with measure values showing more(almost double value) compare to BW Bex report. Can any one please help on this.
    Is it BW problem or BO problem?
    I checked in some other threads but it's not given solution.
    Thanks,
    Manjunatha

    Hi,
    Is it BW problem or BO problem? : BO
    is it causing problem with hierarchly data only ?  without hierarchies data is matching or not?
    Post same in SAP BusinessObjects Web Intelligence  .
    Thanks.

  • How  to compare previouse value in pl/sql array

    DECLARE
    CURSOR stg_raw_cur IS
    SELECT RAW_STG_ID,
    DEVICE_CD,
    MODEL_VERSION,
    PLATFORM_CD,
    PROFILE_COOKIE,
    LOCATION_CD,
    SAMPLE_RATE,
    EVENT_TYPE_CD,
    to_char(to_date(to_date(substr(EVENT_DATE_TIME,1,8),'yyyymmdd')-1 ||
    'T' ||
    substr(EVENT_DATE_TIME,10,8)
    || 'Z','DD-MON-RR"T"HH24:MI:SS"Z"'), 'YYYYMMDDYY"T"HH24:MI:SS"Z"' ) EVENT_DATE_TIME,
    EVENT_SPECIFIC,
    BATCH_ID,
    DWH_ARVL_DT,
    DWH_ARVL_DT_ID,
    DWH_CREATE_DT from dwh_stg.stg_raw where batch_id >= 200
    order by batch_id asc;
    TYPE stgrawarr IS TABLE OF stg_raw_cur%ROWTYPE;
    stg_raw_rec stgrawarr;
    l_batch_id NUMBER :=0 ;
    v_ctr NUMBER :=0;
    l_temp_batch_id number :=0;
    BEGIN
    OPEN stg_raw_cur;
    LOOP
    FETCH stg_raw_cur BULK COLLECT INTO stg_raw_rec LIMIT 100;
    EXIT
    WHEN stg_raw_cur%NOTFOUND;
    END LOOP;
    CLOSE stg_raw_cur;
    for i in stg_raw_rec.first..stg_raw_rec.last
    loop
    dbms_output.put_line('batch id is '|| stg_raw_rec(i).batch_id );
    IF l_batch_id != stg_raw_rec(i).batch_id
    then
    dbms_output.put_line('Different');
    end if;
    l_temp_batch_id := stg_raw_rec(i).batch_id;
    commit;
    end loop;
    END;
    I want to compare previous value of stg_raw_rec(i).batch_id if differnet then increament the value
    else leave the same.
    thanks.

    Try this,
    FOR i IN stg_raw_rec.FIRST .. stg_raw_rec.LAST
       LOOP
          IF l_temp_batch_id != stg_raw_rec (i).batch_id
          THEN
             --increment
             l_temp_batch_id := l_temp_batch_id + 1;
          END IF;
           DBMS_OUTPUT.PUT_LINE ('batch id is ' || stg_raw_rec (i).batch_id||' unique batch id is '||l_temp_batch_id);
        --  DBMS_OUTPUT.PUT_LINE ('batch id is ' || stg_raw_rec (i).batch_id);
        --  IF l_batch_id != stg_raw_rec (i).batch_id
        --  THEN
        --    DBMS_OUTPUT.PUT_LINE ('Different');
        --  END IF;
          l_temp_batch_id := stg_raw_rec (i).batch_id;
          COMMIT;
       END LOOP;

  • How to compare user entered date with current date

    Hi all
    my requirement is, user allowed select one date, in code i have compare this date with current day date. it should be 15days gap other wise display error message.
    I am worried about how to get current date in code. Is there any code to get current date. please reply me with code or mail me at [email protected]
    Thanx
    keerthi

    Keerthi,
    Use the method <b>getDifference()</b> of the DateHelper.java available here.<a href="http://www.koders.com/java/fid14A61FEB1B45A64E42E1DCAD7070B46AE46340BA.aspx">DateHelper</a>
    1. Create a new folder, say Util under your src folder. (com.xyz.util)
    2. Put this DateHelper.java file in that folder,(com.xyz.util) .
    3. Now, write an import statement for this java class in the required view.
    4. Use the getDifference() method of this class to the difference in days between two days.
    Or
    Simply use this code.
    // Get msec from each, and subtract.
    long diff = currDate.getTime() - selectedDate.getTime();
    int noOfDays = diff / (1000 * 60 * 60 * 24);
    where currDate is today's Date and selectedDate is the Date selected by the User.
    Bala

Maybe you are looking for

  • Creating PL/SQL web services from object types

    Hello Jdeveloper, pl/sql web-services working successfully with object types.If we want to send the web-services to the client, do we need to send the entire folder that is created in the web-services folder of the external oc4j..? Creating the clien

  • SCCM 2012 - sms_notificaiton_server install fails, bgbisapi.msi could not be installed

    Hi, installed a SCCM 2012 R2 Primary site on a 2012 R2 server on the D: drive. Everything seemed to go well, however i am am now encountering issues with the SMS_NOTIFICATION_SERVER in that the site component manager is unable to install it. The stat

  • Cannot open yahoo email "show image" in email.

    windows xp pro//firefox 4b9//yahoo email// When I open my email, I have spam guard set to block all images coming in. At the top of the email is an icon which says "SHOW IMAGES" if I want to see the images associated with the email. This works great

  • Accented letters

    I was recently in my company UK office and I was trying to show the designer how to use the keyboard shortcut for accented characters. But when I held down the "E" key, for example, there was no pop-up window that showed the different selections. Is

  • Error copy not allowed

    hi! I need help. I bought me a book and downloaded it on my pc. when I try to put it in my ebook the following message comes: copy is not allowed. But I can open the book on pc! What it is wrong? Is it possible to have one fiile only at one device?