Simple quesstion - Date compare

Hi, I would like to ask how to compare a date with current date in Java.
I tried date.equals() method, but it compare the date and time. However I want to compare the date only. (without time). Thank you very much!

There are many ways to approach this problem. Two off the top of my head:
(1) Use java.text.SimpleDateFormat and put both dates into the same format. Make sure your format only includes the pieces you care about (MM/dd/yyyy for example). Then do a String compare (strObjA.equals(strObjB)) on the resultant output.
(2) Create a java.util.GregorianCalendar object using the times from the date objects. Then use various accessor methods on that object to retrieve the year, month, and day and compare each.
Both of these classes are documented in the java standard APIs.
Hope this helps.

Similar Messages

  • Simple Javascript date() function not executing.

    If I open the javascript input window from a button and enter a simple js date function:
    vDate = new Date();
    alert(vDate();
    This code executes flawlessly when the button is clicked.
    However,  if I place the exact same code in the Execute Advacned Actions javascript window "on enter frame" Action, the alert popup code not exdecute/appear, it will fail silently.
    I'm simple trying to get a javascript funtion to execute on... the On Enter Action.
    Any suggestions?
    Thanks

    Hello,
    I just tried the scenario and I can see that JS code is executing properly. I used the same JS as you have given (just corrected the syntax in the second line). So, I create an Advanced action that has this JS, and I assigned that to "On Slide Enter" action of the slide. Other thing that I did is that I chose "current" as the window in the Execute Javascript options.
    Ashish

  • SQL Server Data Compare doesn't retrieve table list

    I'm trying to do a data compare in Visual Studio 2013.  I have chosen my source and targets and successfully tested the connection to each of them in the connections dialog. 
    When I choose next, there's a few seconds delay as though the compare tool is checking with the source and target and then it shows a dialog with what to compare.  There is a checkbox next to Tables and next to Views.  Those are the only two options
    shown. 
    What should be in this dialog, left of Tables and Views, is an arrow to expand them and show the list of tables and views in the source database.  The arrow is missing and I cannot expand any list of tables or views.  There's just nothing shown
    to compare.
    When I click Next again, the compare appears to run but when complete it reports that zero tables or views were compared - under the circumstances this is as expected because the previous dialog did not allow me to check any tables to compare.
    Why am I not getting the arrow to expand the list of tables?  What's wrong with Data Compare?
    Thanks,
    Dale

    Hi Dale,
    >>In your image you show a primary key value in comparison key but my tables did not have a primary key assigned
    >>Is the comparison key requirement by design? 
    I repro it, I get the same issue as yours, if no key, we couldn't compare the tables.
    Like the document here:
    https://msdn.microsoft.com/en-us/library/dn266029%28v=vs.103%29.aspx?f=255&MSPPError=-2147217396
    https://msdn.microsoft.com/en-us/library/aa833428(v=vs.100).aspx
    Requirements
    When you compare data in a table or view, the table or view in the source database must share several attributes with a table or view in the target database. Tables and views that do not meet the following criteria are not compared and do not appear
    on the second page of the      New Data Comparison   wizard:
    Tables must have matching column names that have compatible data types.
    Names of tables, views, and owners are case-sensitive.
    Tables must have the same primary key, unique index, or unique constraint.
    Views must have the same unique, clustered index.
    You can compare a table with a view only if they have the same name.
    Each object has a key or an index that determines the other objects to which it corresponds. However, each table or view can have more than one primary key, unique index, or unique constraint. Therefore, you might want to specify which key, index,
    or constraint to use.
    As my understanding, it would have the specific requirements.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • VS2012 SQL Data compare

    Dear Sirs,
    Concerning the tools comparing data in VS2012(SQL - Data compare ) it is possible to run this comparison by timer  for example :" each two minutes comparing the database if not equal update the target".
    Best Regards
    Nicolas Chami

    Hi Nicolas. It sounds like what you want is to enable replication on your database.
    Here is the main help page
    for replication. This should have the right links to get you started. Regards,
    Kevin

  • JSTL Date Compare Question

    I am using JSTL to parse an xml feed (news articles) and need to restrict the articles I get back in the xml to todays date. On another page I am working on I have to restrict the articles to todays date - 7 days (one week). I understand how to parse and format dates with jstl, but am stuck on doing date compares like this. The date I have to restrict on in the xml feed is called <pubDate>. If anyone could help me out with using JSTL to parse and handle these date ranges that would be great. Here is a portion of the xml I am dealing with:
    - <!-- Item 1 of todays_free_feature
    -->
    - <item>
    <title>Building an Online Library</title>
    <link>http://online.wsj.com/public/article/0,,SB113111987803688478-VNpw62xi_JA4avE8cxOZf0pf_nM_20061109,00.html?mod=rss_free</link>
    <description>Liz Ridolfo is one of several foot soldiers engaged in an ambitious effort to digitize the world's libraries, one volume at a time.</description>
    <pubDate>Tue, 08 Nov 2005 20:22:00 EST</pubDate>
    </item>
    - <!-- Item 2 of todays_free_feature
    -->
    - <item>
    <title>Guest-Worker Proposals Prove Divisive</title>
    <link>http://online.wsj.com/public/article/0,,SB113149831207391770-V6OGF4bCCsOhJlj0ZAPd1jKIMUg_20061109,00.html?mod=rss_free</link>
    <description>Bush is proposing a guest worker program that business loves and the Senate seems eager to pass, but the issue splits Republicans eager to help business from those concerned about border security, job losses and the nation's identity.</description>
    <pubDate>Tue, 08 Nov 2005 23:02:00 EST</pubDate>
    </item>
    - <!-- Item 3 of todays_free_feature
    -->
    - <item>
    <title>Changing Times at the Fed</title>
    <link>http://online.wsj.com/public/article/0,,SB113136589127989951-biMkDwuEVMUvrmqav2YE8OCApTk_20061109,00.html?mod=rss_free</link>
    <description>Alan Greenspan will soon step down as Federal Reserve chairman and hand the reins to Ben Bernanke. But that's not the only change likely to be in store at the U.S. central bank. William Polley and Tim Duy to explore what the future might hold for the seat of U.S. monetary policy.</description>
    <pubDate>Tue, 08 Nov 2005 20:46:00 EST</pubDate>
    </item>
    - <!-- Item 4 of todays_free_feature
    -->
    - <item>
    <title>Protecting Ideas Is Crucial for U.S. Business</title>
    <link>http://online.wsj.com/public/article/0,,SB113149228287891613-mKwE4jbbsNWEvRsGvadhQNc6tGI_20061109,00.html?mod=rss_free</link>
    <description>Intellectual property is one of the thorniest problems facing modern capitalism. The challenge is to protect creators' right to profit while still ensuring that the benefits of their creations are widely spread.</description>
    <pubDate>Tue, 08 Nov 2005 22:50:00 EST</pubDate>
    </item>

    I had problems following your advice, hence I used a different formatter
    <fmt:formatDate var="nextRunStr" value="${reminder.nextRunDateTime}" pattern="yyyyMMddHHmmss"/>
                                  <fmt:formatDate var="nowStr" value="${now}" pattern="yyyyMMddHHmmss"/>
    and then
    ${nextRunStr ge nowStr}"
    seems to work OK.

  • Where's Data Compare?

    I've been away from the Microsoft stack for a few years doing Java but I have kept up my MSDN subscription and still have all the tools. 
    Somewhere, while I wasn't looking, it appears that Data Dude (the Database Pro version/tools in Visual Studio, has disappeared.  Now I find myself trying to do a data compare between two tables in the same database, even tried duplicating the problem
    across two different databases, and I can't get a data compare to work.
    I downloaded the SQL Server Data Tools - both editions: SQL Server and Visual Studio - and I find the data compare on the Visual Studio version - but not at all like the current VS2013 blogs and instructions present it.  I was able to add the two connections
    I need and run the compare but there are no results.  The compare window says there were 0 tables or views compared.
    What gives?  What do I need to do to get a data compare, either in two separate databases or two tables in the same database, to work?  Please Help!

    Thanks, Joe.  I found the menu item; it's not where it was in earlier versions where there was a Data menu.  You're right about the same-DB compare.  I had to do just as you said, create a new DB and copy one table there.
    The other change between the early, red-gate-based, data compare in Visual Studio is that now you must have a primary key defined on both tables.  My tables were throwaway tables just for purposes of this test and didn't have primary keys assigned. 
    I didn't get a compare until I added the primary keys.
    Right, you must have a primary key so that Data Compare knows which rows to compare. If you don't have a primary key the table name will not come up in the list of tables available for comparison.

  • Oracle.jbo.domain.Number / Date comparable ?

    Hello,
    I'd like to know whether there was a plan to make the oracle.jbo.domain.Number and oracle.jbo.domain.Date classes implement the Comparable interface?
    That would save some unnecessary wrapping code...
    Thanks in advance,
    Remi

    I just want to push this Idea, since it is hard to understand, why such a simple interface is not implemented for such a basic class. It would make a lot of things much easier.

  • Numbers for simple school data

    Hey,
    I'm completly new to speadsheets and have beem asked to compare my subject (I'm a teacher) to another's results.
    I just want to be able to get the:
    - percentages of A-Bs and A-Cs etc per the two classes
    - if possible, highlight where my subject was higher/lower than the other results for that student (I've removed the names column for purpose of showing my data)
    I am using numbers 3.1 on my Mac. I'm sure there is most likley a very simple way to do this, but I am very unfamilar in the world of spreadsheets!
    Can any offer any much-appreciated help?

    Hi Kipp,
    You wrote:
    - percentages of A-Bs and A-Cs etc per the two classes
    For this, you'll need to count the number of each letter grade, then divide the sum of the counts for grades in the range you want to compare by the sum of the counts for all of the grades. The result will be a decimal fraction. Format the cell to display as percentage. In the example below, these results are shown in Table 2.
    - if possible, highlight where my subject was higher/lower than the other results for that student (I've removed the names column for purpose of showing my data)
    This can be done using conditional formatting to compare the cell containing your student's grade with the cell containing the other teacher's grade for the same student. Done most conveniently if you have the grades in adjacent columns. In the example below, this is shown on Table 1.
    Example:
    Table 1 (Left):
    All data shown has been randomly generated for the example. In your case, this data would be pasted in from your grade book and from your colleague's.
    The conditional format rules for cells in column B are shown for cell B15 (selected). The other rule sets are the same, but the two cell references shown are made to the cell in the same row of column C as the row of the cell to be formatted. See Numbers Help for details on how to do this.
    Table 2:
    There are three versions of essentially the same formula here.
    B2, filled right then down to C6: =COUNTIF(Table 1 :: B,$A2)/COUNTA(Table 1 :: B)
    B8, filled right to C8:
    =(COUNTIF(Table 1 :: B,$A2)+COUNTIF(Table 1 :: B,$A3))/COUNTA(Table 1 :: B)
    B10, filled right to C10:
    =(COUNTIF(Table 1 :: B,$A2)+COUNTIF(Table 1 :: B,$A3)+COUNTIF(Table 1 :: B,$A4))/COUNTA(Table 1 :: B)
    Each instance of COUNTIF counts the items in column B of Table 1 that match the grade listed in the specified cell of Table 2.
    COUNTA counts all on the text entries in column B of Table 1.
    Example is constructed in Numbers '09. Appearance will differ slightly in Numbers 3.
    Regards,
    Barry

  • How can I completely uninstall Simple Pass Data file? where is data file kept?

    Computer came with Simple Pass finger print reader.  Won't let me program Windows log on unless I enter Windows log on password.  I DO but it says "incorrect from what was originally password."
     I don't know what that would be, (tried all old passwords)  so I want to ERASE ALL RETAINED DATA and reinstall.  
    ADD/REMOVE program removes program but data retained.  Then deleted Validity Sensor under Biometric devices so all data should be gone but upon reinstall it still says i have wrong password!
    Where else is this data kept on computer and how can i remove so I can fix program?
    Anyone familiar with Simplepass or recommend another fingerprint program that would work with HP Envy?
    Thanks in advance.
    This question was solved.
    View Solution.

    Frank,
    Updating the OS to Windows 8.1 does destroy the Recovery Manager -- side "benefit" that seems to go unmentioned by some of the enthusiasts of Upgrades.  On the other hand, unless the system comes with 8.1 there is little you can do -- Windows 8 is rather sad.    You have the choice of a weird hybrid "almost" Windows 8.1 or running Windows 8.  Eeeew.  I chose the upgrade on the one Windows 8 system I have -- same level of frustration but at least the problems are different than running sad Windows 8.  Smiling.
    Because you know your system runs Windows 8.1 -- and there are apparently the Drivers at your system's HP Support pages for Windows 8.1 (very important), you might consider purchasing Windows 8.1 Pro and being done with the hybrid upgrade OS.  You still lose the Recovery Manager, of course, purchased 8.1 does not provide the HP Recovery Manager -- but at least the OS is stable.   You still install the HP drivers from the computer's Support site, of course.  I actually purchased 8.1 for my upgrade system and have only been too lazy to install it.  Sigh.
    You can use third party Image software to back up the system.  Certainly not the only one, and maybe not even the best according to whom you ask -- one such tool: 
    Redo software is free and is NOT Windows dependent. 
    The software can be used with Both Windows and Linux Operating Systems.
    Redo Backup – Recovery – Bare Metal Restore
    Please read the HELP / FAQ page.
    Reference:
    Windows 8 Features – A Quick Tour
    =======================================================================
    You might go ahead and create that extra local admin account -- there is nothing like the clarity of hindsight.  I dislike this error about mismatched passwords.
    Click the Kudos Thumbs-Up to say Thank You!
    And...Click Accept as Solution when my Answer provides a Fix or Workaround!
    I am pleased to provide assistance on behalf of HP. I do not work for HP. 
    Kind Regards,
    Dragon-Fur

  • Simple java date related question

    Hi Friends,
    I have written this custom date class that compares two dates. The user can enter any number of days,and it should calculate the next date,is that possible???
    public class Date implements Comparable {
         private int month, day, year;
         public Date(int m, int d, int y) {
              month = m;
              day = d;
              year = y;
         public int compareTo(Object o) {
              Date a = this;
              Date b = (Date) o;
              if (a.year < b.year) return -1;
              if (a.year > b.year) return 1;
              if (a.month < b.month) return -1;
              if (a.month > b.month) return 1;
              if (a.day < b.day) return -1;
              if (a.day > b.day) return 1;
              return 0;
         public String toString() {
              return month + "/" + day + "/" + year;
         public static void main(String[] args) {
              Date d1 = new Date(21, 03, 2007);
              int days = Integer.parseInt(args[0]);
              System.out.println("New date is:"); // Need to print new date
    Expected output:
    java Date 30
    New date is: 04/20/2007If this is not possible with this class,how can we do this, any ideas.
    Your help would be appreciated.
    Thanks

    Hi,
    Try this code out:
    import java.text.DateFormat;
    import java.util.*;
    import javax.swing.JOptionPane;
    public class SimpleDate {
         private int month, day, year;
         public SimpleDate() {
              Date date = new Date();
             String myString = DateFormat.getDateInstance().format(date);
             StringTokenizer tokens = new StringTokenizer(myString, "/");
             day = Integer.parseInt(tokens.nextToken());
             month = Integer.parseInt(tokens.nextToken());
             year = Integer.parseInt(tokens.nextToken());
         public SimpleDate(String stdate) {
              try {
                   StringTokenizer tokens = new StringTokenizer(stdate, "/");
                   day = Integer.parseInt(tokens.nextToken());
                   month = Integer.parseInt(tokens.nextToken());
                   year = Integer.parseInt(tokens.nextToken());
              catch(Exception e) {
                   Date date = new Date();
                  String myString = DateFormat.getDateInstance().format(date);
                  StringTokenizer tokens = new StringTokenizer(myString, "/");
                  day = Integer.parseInt(tokens.nextToken());
                  month = Integer.parseInt(tokens.nextToken());
                  year = Integer.parseInt(tokens.nextToken());
                   JOptionPane.showMessageDialog(null, "Invalid String,\nDate set to current", "Invalid String", JOptionPane.ERROR_MESSAGE);
         public SimpleDate(int d, int m, int y) {
              month = m;
              day = d;
              year = y;
         public int compareTo(Object o) {
              SimpleDate a = this;
              SimpleDate b = (SimpleDate) o;
              if (a.year < b.year) return -1;
              if (a.year > b.year) return 1;
              if (a.month < b.month) return -1;
              if (a.month > b.month) return 1;
              if (a.day < b.day) return -1;
              if (a.day > b.day) return 1;
              return 0;
         private int getNumOfDaysInMonth() {
              boolean leap = false;
              int days = 30;
              if (year % 4 == 0) leap = true;
              if ((month == 1) | (month == 3) | (month == 5) | (month == 7) |
                        (month == 8) | (month == 10) | (month == 12)) {
                   days = 31;
              if ((month == 4) | (month == 6) | (month == 9) | (month == 11)) {
                   days = 30;
              if (month == 2) {
                   if (leap) {
                        days = 29;
                   else days = 28;
              return days;
         public void addDays(int nums) {
              while (nums > getNumOfDaysInMonth()) {
                   nums = nums - getNumOfDaysInMonth();
                   addMonths(1);
              day = day + nums;
              while (day > getNumOfDaysInMonth()) {
                   day = day - getNumOfDaysInMonth();
                   addMonths(1);
         public void addMonths(int nums) {
              while (nums > 12) {
                   nums = nums - 12;
                   addYears(1);
              month = month + nums;
              while (month > 12) {
                   month = month - 12;
                   addYears(1);
         public void addYears(int nums) {
              year = year + 1;
         public int getDay() {
              return day;
         public int getMonth() {
              return month;
         public int getYear() {
              return year;
         public String toString() {
              return day + "/" + month + "/" + year;
    }I have swapped the day and month around from mm/dd/yyyy to dd/mm/yyyy
    but otherwise its still the same basic code

  • XSL for a Pie chart with a very simple XML data file

    Hi All
    Using BI Pub Desktop 10.1.3.2.1 with Oracle Apps R12.1.3.
    I am trying to do a pie chart for the below data in an xml file. Normally this is pretty straight forward but with the below simple data structure I am a bit stuck, maybe thinking about it too much. Appreciate any help on what the xsl should like.
    xml file contains only the below. There is no other data in the file.
    <G2>
    <ITEM>ALL</ITEM>
    <AA>10</AA>
    <BB>20</BB>
    <CC>50</CC>
    <DD>30</DD>
    </G2>
    I want to be able to have a pie chart that shows the labels: AA, BB, CC and DD with the corresponding data values of 10,20,50 and 30.
    Thanks for viewing the question.
    Cheers Cel

    Please disregard. i went back to the original blog code and started over, and figured this out.

  • Data compare

    Hi
    I would like to run below query on all tables, however it doesnt work on clob and long datatypes
    select * from owner.table_name
    minus
    select * from owner.table_name@remote_db;
    from dba_tables
    where owner in ( '....');
    ORA-00932: inconsistent datatypes: expected - got CLOB
    How can I compare the data of clob and long datatypes using dblink ?

    you can not pass clob data over a dblink. you can use plsql to help if it is necessary. you can create a package and describe a cursor in it, then write a function which will return next 4000 char of clob and you can get all clob data using this. why do you want to compare clobs ? what is your purpose, what data is in clob ?

  • Error during date comparing

    Hi , i have situation , where i have to find a date between two dates
    i used below filter condition, but i get error
    (TO_DATE(PLAYER_MONTHLY_SUMMARY.CURRENT_MONTH, 'DD-MON-YYYY') BETWEEN
    TO_DATE('01-MAR-2012', 'DD-MON-YYYY') AND
    TO_DATE('31-MAR-2012', 'DD-MON-YYYY')
    Error :-
    ORA-12801: error signaled in parallel query server P000
    ORA-01841: (full) year must be between -4713 and +9999, and not be 0
    ORA-02063: preceding 2 lines from EDW_REP_DBLINK
    12801. 00000 - "error signaled in parallel query server %s"
    *Cause:    A parallel query server reached an exception condition.
    *Action:   Check the following error message for the cause, and consult
    your error manual for the appropriate action.
    *Comment:  This error can be turned off with event 10397, in which
    case the server's actual error is signaled instead.
    is their any error in code or this error is db level

    Hi,
    916710 wrote:
    hi ,
    here are the details
    CURRENT_MONTH is date datatype in PLAYER_MONTHLY_SUMMARY table TO_DATE, as the name implies, converts something TO a DATE . If current_month is already a DATE, you don't need to convert it to a date.
    Besides, the 1st argument to TO_DATE is supposed to be a VARCHAR2. Don't use a DATE where a VARCHAR2 is expected.
    and date range is from next_run_date where my next_strt_date and next_end_date both are date datatype
    instead of this below query
    (TO_DATE(PLAYER_MONTHLY_SUMMARY.CURRENT_MONTH, 'DD-MON-YYYY') BETWEEN
    TO_DATE('01-MAR-2012', 'DD-MON-YYYY') AND
    TO_DATE('31-MAR-2012', 'DD-MON-YYYY')
    if i try below one then it worked
    PLAYER_MONTHLY_SUMMARY.CURRENT_MONTH BETWEEN
    TO_DATE('01-MAR-2012', 'DD-MON-YYYY') AND
    TO_DATE('31-MAR-2012', 'DD-MON-YYYY')
    is this approach is rightYes, that's comparing a DATE (current_month) to other DATEs (the results of TO_DATE).
    Remember that all DATEs in Oracle include hours, minutes and seconds. If the hours, minutes and seconds of current_month are always 00:00:00 (for example, if current_month is always populated with TRUNC (some_date, 'MONTH')) then the comparison above is okay. But if current_month can be something like 6:52;31 on March 31, 2012, then it will fail the condition, becuase the upper end of the range is
    TO_DATE('31-MAR-2012', 'DD-MON-YYYY') which is 00:00:00 on March 31, 2012. To include current_month that is any time of day on March 31, you'd have to do something slightly diferent, such as
    PLAYER_MONTHLY_SUMMARY.CURRENT_MONTH  BETWEEN TO_DATE ( '01-MAR-2012'     -- Default time, 00:00:00, is okay here
                                                    , 'DD-MON-YYYY'
                              AND     TO_DATE ( '31-MAR-2012 23:59:59'
                                                    , 'DD-MON-YYYY hh24:mi:ss'
                                        ) or
         PLAYER_MONTHLY_SUMMARY.CURRENT_MONTH  >= TO_DATE ( '01-MAR-2012', 'DD-MON-YYYY')
    AND  PLAYER_MONTHLY_SUMMARY.CURRENT_MONTH  <  TO_DATE ( '31-MAR-2012', 'DD-MON-YYYY') + 1

  • Best Practice Question for Date Compares

    Hello,
    I'm far from an expert on Oracle and PL/SQL, so I may have this all wrong.  I'm working on some selection scripts, and the guy that wrote these before me likes to convert parts of dates to numbers in order to do a compare.  It seems to me a trunc(date, part) would be much more efficient.  Can anyone confirm my thoughts here?
    I'm seeing this a lot:
    AND    TO_NUMBER (TO_CHAR (scheduleddate, 'YYYY')) = TO_NUMBER (TO_CHAR (SYSDATE - 1, 'YYYY'))
    Seems to me that I'd be better off just doing:
    trunc(scheduleddate, 'YEAR') = trunc(SysDate, 'YEAR').
    Does that make sense?
    Thanks!
    Chad

    CSchrieber wrote:
    Hello,
    I'm far from an expert on Oracle and PL/SQL, so I may have this all wrong.  I'm working on some selection scripts, and the guy that wrote these before me likes to convert parts of dates to numbers in order to do a compare.  It seems to me a trunc(date, part) would be much more efficient.  Can anyone confirm my thoughts here?
    I'm seeing this a lot:
    AND    TO_NUMBER (TO_CHAR (scheduleddate, 'YYYY')) = TO_NUMBER (TO_CHAR (SYSDATE - 1, 'YYYY'))
    Seems to me that I'd be better off just doing:
    trunc(scheduleddate, 'YEAR') = trunc(SysDate, 'YEAR').
    Does that make sense?
    Thanks!
    Chad
    however , you might want to play around with it a bit to confirm you get the behavior you want in your context.  I've not had much reason to use trunc, and in testing a few things just now to reply to admin1, I got some results that surprised me.  Another little learning project for me now.
    But I stand behind the essence of my original reply.  The guy that wrote your original code was jumping through too many hoops (transform functions).

  • Read Year from System Date & Compare - Assistance required

    Hi All,
    I am trying to read only the year part from the system date & then checking if any entry exists in EKKO table (EKKO-BEDAT) for the year. I think i am making an error in my data declaration for V_YEAR & in my select statement (EKKO~BEDAT LIKE V_YEAR), not sure how to compare only the year part, can someone help.
    DATA:
        V_EBELN TYPE EKPO-EBELN,
        V_YEAR  TYPE SY-DATUM.
    CLEAR: V_EBELN, V_YEAR.
    *Read year from system date
    V_YEAR = SY-DATUM+0(4).
    CONCATENATE '%' '%' '%' '%' V_YEAR INTO V_YEAR.
    *Select section
    SELECT SINGLE EKPO~EBELN INTO V_EBELN
    FROM EKPO
      INNER JOIN EKKO
        ON EKPOEBELN = EKKOEBELN
      INNER JOIN LFM1
        ON EKKOLIFNR = LFM1LIFNR
       WHERE EKKO~LIFNR = LFM1-LIFNR
         AND EKKO~BEDAT LIKE V_YEAR
         AND EKPO~LOEKZ = SPACE.

    Hi Sougata,
    Thanks for the inputs, but it is not working:
    Move:      sy-datum(4) to v_begda, -> This reads the system year 2008
            '0101'     to v_begda,  -> This changes 2008 to 0101
            sy-datum(4) to v_endda, -> This reads system year i.e. 2008
            '1231'     to v_endda. -> This changes 2008 to 1231
    Also in the select statement
    AND EKKO~BEDAT between v_begda and v_endda 
    This would not work, as EKKO-BEDAT is in year month date format.
    So can you please clarify why we are assigining 0101 & 1231 & also how we can compare only the year in EKKO-BEDAT with System Year
    Update
    I tried to
    concatenate '0101 into v_begda.
    concatenate '1231' into v_endda.
    but system prompts "charlike-field" expected after "'0101'"
    Can you please advice?
    Edited by: Vivek on Jan 5, 2008 7:59 PM

Maybe you are looking for

  • How can i use my iPod on two different computers?

    I recently bought a new laptop and i plugged in my ipod shuffle but i cant add any new music to it because it was originally set up on my old laptop. Unlike other ipods, when i plug it back into the old laptop, there is no box to check like "Manually

  • Reader 11.0.5 Can't Print

    Using Reader 11.0.5 on Windows 7. Try to print to a network printer and receive messages "The document could not be printed." and "There were no pages selected to print." I have uninstalled, downloaded, and reinstalled reader. Documents from other so

  • Integration with Remedy ARS to SAP using web services

    Hi! There have been made a wsdl file from a sap babi, this file is loaded into remedy and the fields are mapped (input and output). When doing a search from the remedy using the wsdl file, we get the error "No selection criteria specified", even if t

  • Displaying an exception during UI Logon

    Hi Experts, i am facing critical issue on my production system. On testing client, all the development done was working properly and everything moved to production. When i logged into CRM UI on production, i am getting an error 'Diagnosis An exceptio

  • Processing in Adobe forms

    Hello Gurus, I am new to adobe forms. I need to do some data processing in the adobe form. Based on some condition, I would like to move the value of a the record being looped to a structure being passed to the form and clear the internal table recor