Skip to Content
avatar image
Former Member

How to display data according to fiscal year?

Hi Gurus,

Please tell me the code in web dynpro java to display data according to fiscal year (April to March).

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Sep 09, 2014 at 11:10 AM

    I don't think that anyone can help you with that because no one can even imagine what you are trying to do and where exactly the problem is... So maybe tell us some more?

    Regards

    Tobias

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 09, 2014 at 12:20 PM

    Hi,

    If you have a specific question, please ask it here - however if you are looking for someone to supply a complete code solution for your work then that isn't what SCN is for. Please think about just what you want and post back again.

    Cheers,

    G.

    Add comment
    10|10000 characters needed characters exceeded

    • hi shilpi mahajan,

      you can use the below code that is prepared statement is always preffered, because it saves time in processing data base query.

      SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
      java.util.Date startDate = formatter.parse(sdate);
      java.util.Date endDate = formatter.parse(edate);
      PreparedStatement pstmt = connection.prepareStatement("SELECT sales.InvoiceNumber, sales.ShipToAddress, sales.Date "
      + "FROM sales, customers "
      + "WHERE sales.CardRecordID = customers.CardRecordID "
      + "AND customers.Name = 'Cash Sales' "
      + "AND sales.Date BETWEEN ? AND ? "
      + "ORDER BY sales.ShipToAddress ASC, sales.Date DESC");
      pstmt.setDate(1, new java.sql.Date(startDate.getTime()))
      pstmt.setDate(2, new java.sql.Date(endDate.getTime()))

      Calendar cal = Calendar.getInstance();

      cal.add(Calendar.YEAR,-1);

      Date startDate= new Date(cal.getTimeInMillis());

      Date endDate = new Date(System.currentTimeInMillis());

      here Date highlighted in bold is of type java.sql.date and start date is one year before the current date .

      Regards

      Govardan Raj S

  • avatar image
    Former Member
    Sep 19, 2014 at 06:02 AM

    HI all,

    thanks for your instant answers. here the data is in the form of months and year, in two different columns. i tried the code which you have given me it is not taking that.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 22, 2014 at 10:32 AM

    hi,

    i have tried the code given by Vijay Kumar Kalluri and you. none is working. i want the data to be displayed on the basis of month and year.

    for example: if user selects March 2014, the data should be displayed from March 2013 to December 2014 and January 2014 to March 2014.

    What will be the code for that? I am using SQL query to fetch data from database on web dynpro java.

    thanks & regards

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Shilpi Mahajan,

      See,

      By using WD-JAVA, you will pass some parameter(Input Details) to the your SQL query, that SQL query is returns some Output(Table). This is the way we will devlop the WD-JAVA application.

      Please check with SQL Developer?