What is the different the logic in here

Hi method one work fine but method two no
what mistake in method two
two
Date sdate = null;
    Date edate = null;
    Date oldDay =null;
   temp = request.getParameter("sdate");
   String temp1=request.getParameter("edate");
    Calendar cal = Calendar.getInstance();
    cal.setTime(new Date());
    cal.set(Calendar.DAY_OF_MONTH, 1);
/** if((temp==null)&&(temp1==null))
      sdate = cal.getTime();
      cal.add(Calendar.MONTH, 1);
      cal.add(Calendar.DATE, -1);
      edate = cal.getTime();
      if(temp != null){
      sdate = StringFormater.transformDate(temp);
      //if first date is selected and biger than the laast day
       edate = cal.getTime();
      if(sdate.after(edate)){
      cal.setTime(sdate);
      cal.add(Calendar.MONTH, 1);
      cal.add(Calendar.DATE ,-1);
      edate = cal.getTime();
      //session.setAttribute("oldDate", edate);
     else {
        session.setAttribute("oldDate", edate);
        edate=(Date)session.getAttribute("oldDate");
     }  */one
if (temp != null) {
        sdate = StringFormater.transformDate(temp);
    else {
        sdate = cal.getTime();
    temp = request.getParameter("edate");
    if (temp != null) {
        edate = StringFormater.transformDate(temp);
    } else {
        cal.add(Calendar.MONTH, 1);
        cal.add(Calendar.DATE, -1);
        edate = cal.getTime();
  if(sdate.after(edate)){
    cal.setTime(sdate);
    cal.add(Calendar.MONTH, 1);
    cal.add(Calendar.DATE ,-1);
    edate = cal.getTime();
  }thank you

for the following code
i can't let the else work , we have two calendar on jsp , we want
the defaul is the 12 /1(sdate) to 12/31(edate)
i f i change the sdate to 1/1/2007 then the end should be automatically to 1/31/2007
and if the first one is 1/2/2007, then 1/28/2007, but if the first one change to 1/1/2007 the end one should keep 1/28/2007 not change,
the secode one do the job, and yes the logic is more better , but I want to know what mistake I made in the way one??
if(temp != null){
      sdate = StringFormater.transformDate(temp);
      //if first date is selected and biger than the laast day
       edate = cal.getTime();
      if(sdate.after(edate)){
      cal.setTime(sdate);
      cal.add(Calendar.MONTH, 1);
      cal.add(Calendar.DATE ,-1);
      edate = cal.getTime();
      //session.setAttribute("oldDate", edate);
     else {
        session.setAttribute("oldDate", edate);
        edate=(Date)session.getAttribute("oldDate");
     } Thank you

Similar Messages

  • Why not to Join Fatc to fact tables in OBIEE... What is the Logical Reason

    Why not to Join Fatc to fact tables in OBIEE... What is the Logical Reason
    Thanks in advance
    V

    Hi Venkat,
    I am coming from the basics of a star schema here, so hope it helps
    What is a fact?
    A fact is something that has all measures which can be aggregated (Units, Dollars, # of Orders) etc with keys to different dimensions.
    What is a dimension?
    It is the context with which we understand/record/retrieve the measures in the fact. We understand "# of Orders" for a product/By a customer etc.
    So joining a dimension and a fact helps to answer the Who/What/When kind of business questions. Ex : Who bought these products? What was the product type? When these products were sold kind of...
    Now just imagine tying up fact to another fact. With this kind of model, you can never answer any business question.
    I have never tried joining a fact with another fact in OBI (But do not think it will allow it though :) )
    Hope I am clear.
    Thank you,
    Dhar

  • What are the logical structure and physical structure in oracle

    what are the logical structure and physical structure in oracle and how can allocate a DB block size as default size is 8192?

    From the Concepts Guide
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14220/toc.htm
    The physical structures are:
    Datafiles
    Control Files
    Redo Log Files
    Archive Log Files
    Parameter Files
    Alert and Trace Log Files
    Backup Files
    The Logical Structures are:
    Tablespaces
    Oracle Data Blocks
    Extents
    Segments

  • What is the logic for 2LIS_17_I3HDR to pick a order as completed on time?

    Hi, Experts:
    I am working on PM using 2LIS_17_I3HDR to load data. In 2LIS_17_I3HDR, there is a field called "orders completed on-time". I am wondering what is the logic for 2LIS_17_I3HDR to identify if an order was completed on time. I would assume it compares some kind of completion/finish date with a planed/schduled comletion/finish date. Would someone please tell me what fields in what table or in transaction IW39 DOES does 2LIS_17_I3HDR  use for this?
    Many thanks!
    Jenny

    Hi, Ram:
    Thank you for the reply!
    The key figure is ZHLAFIH_TGERL (Number of On-time Closed Orders). I saw some SAP programs refering to its component type "DZHLAFIH_TE" too.
    Thanks,
    Jenny
    Edited by: Jenny Chen on Dec 2, 2009 7:53 PM
    Edited by: Jenny Chen on Dec 2, 2009 7:55 PM

  • What is the logical system name used for in R/3?

    We have a R/3 server. The production client has a logical system name. What is the logical system name used for?
    Tony Tam

    Hi Tony
    Following Links will help you in understanding the concept
    http://benstudycenter.blogspot.com/2008/02/logical-system.html
    http://help.sap.com/saphelp_sm32/helpdata/en/78/217dc151ce11d189570000e829fbbd/frameset.htm
    http://help.sap.com/saphelp_sm32/helpdata/en/78/217dc151ce11d189570000e829fbbd/frameset.htm
    thanks
    Bhudev

  • Why when I uncheck the McAfee box I am forced to download McAfee to get the latest version of Flash Player? What is the work around here?

    Why when I uncheck the McAfee box I am forced to download McAfee to get the latest version of Flash Player? What is the work around here?

    I received your PM.  Yes, the links have changed:
    Flash Player for ActiveX (Internet Explorer)
    Flash Player Plug-in (All other browsers)
    Flash Player for Mac OS X

  • What are the logical databases belongs to HR module.

    Hi experts,
    Please explain What are the logical databases belongs to HR module.
    Thanks,
    Rashmi

    Hi Rashmi,
    There are three LDBs in HR.
    1. PNPCE or PNP
    2. PCH
    3. PAP
    Good Luck
    Om

  • What is the logical message type for Inbound Credit Memo (MM)

    Hi Folks,
    What is the logical message type for Inbound Credit Memo (MM)
    Plz explain.
    Thanks,
    Matt

    Hi Mat,
      The logical message types are as follows.
      /DSD/HH_CREDITDATA             DSD Credit Exposure and Credit lLmit
      CREADV                         Credit memo display
      CRESTA                         Copy credit status (DebtorCreditAccount)
      SBINV                          Credit memo procedure with invoice creation
      SBWAP                          SD Credit Memo Procedure with Automatic Postin
    You can search for message types in database table EDMSG.
    Regards,
    Vimal.

  • What is the Logical Link ID?

    what is the logical link ID? when we define a new work center or logical link in web UI, we need to maintain logical link ID. can anybody plz explain me how it works?

    Hi ,
    To tell you in short, logical link id tells you about the target ID.  Target ID means where actually you want to go after clickinga particular link ( work centre, Direct links etc)
    Target ID stores the information about the component name and windows.
    There is alot more to it for which you would need to read documentation available at SDN.
    Regards jotsaroop singh

  • What is the logical use of defining Dimension Object Relationships in DBI?

    Hi!
    I am reading the Oracle Daily Business Intelligence Implementation Guide and as I am following the guide on how to extend DBI, I saw a section which discusses how to create dimension object relationships. Until now, I could not fully realize what is the logical use of defining this relationship among dimension objects. I hope someone can enlighten me on this matter...
    Thanks.

    It LIVES ON FOREVER, and starts to take on its own personality, hungrily chasing down other objects in memory and ATTACKING THEM AT WILL. Also it grows over time, in its evil attempt to CONSUME YOUR ENTIRE MACHINE, and comes out and EATS YOU UP TOO! MWAHHHAAAHHHAAAA
    No wait, that was a sci-fi. It just lives until no more references to it exist and thus becomes eligible for garbage collection, and is only a "JAVA" feature not JDBC.

  • What is the logic in the Application Builder

    Hi guys,
    What is the logic in the application builder when creating e.g a Report. When we create a static report we go through these four steps:
    <ul>
    Display Attributes
    Source
    Report Attributes
    Conditional Display </ul>
    Starting from the "Source" step we can Click "Create Report", and create the report .....
    is there a table for each step... or there is a collection for each step. So, when we click Create Button the collections are inserted into tables, then get emptied. ?????
    In my case, i have three real-estate entities: landlords, properties, and marketing. it goes like this:
    enter the landlord details, then click create to move to the next page to enter the property details, then click create to move to the next page to enter the marketing details.
    i hope that my question is clear..
    Best Regards,
    Fateh

    Fateh wrote:
    Hi guys,
    What is the logic in the application builder when creating e.g a Report. When we create a static report we go through these four steps:
    <ul>
    Display Attributes
    Source
    Report Attributes
    Conditional Display </ul>
    Starting from the "Source" step we can Click "Create Report", and create the report .....
    is there a table for each step... or there is a collection for each step. So, when we click Create Button the collections are inserted into tables, then get emptied. ?????
    In my case, i have three real-estate entities: landlords, properties, and marketing. it goes like this:
    enter the landlord details, then click create to move to the next page to enter the property details, then click create to move to the next page to enter the marketing details.That would be called a "wizard" in APEX (as frequently used in the Application Builder as you say). There's a "Wizard wizard" as an option when creating a new page that enables you create and link the basic multiple page structure. Themes have "Wizard Progress List" (vertical orientation) and "Wizard Progress List, Horizontal Train" (horizontal) list templates that can be used as stage progress indicators. You have to construct the contents of each page using standard components. Once the "Wizard wizard" is completed there's nothing to indicate that the pages are logically related&mdash;strangely it doesn't even generate a wizard progress list for you.
    Use Collections to store the data from intermediate stages before final processing if all of the data is captured in one session. If you want persistence across sessions (e.g. allowing users to enter information over several days) use separate drafting/staging tables instead of/in addition to collections to capture the data before final validation and promotion to the main tables.

  • My aunt just bought her phone ( iphone 5c ) but then when i tried entering the serial number on apple's site it shows as iphone 5s. I asked my aunt what's the color of her phone and she said it was green and it was iphone 5c. Could this be a fake iphone?

    My aunt just bought her iphone (5c) for half of its original price here in Phils. So to check it was a
    Egit one, i asked for the serial number by checking the settings of her phone. After geting the serial nu,ber, i entered it in apple's site to verify. I was kinda surprised since the phone that appeared was 5s instead of 5c. I asked my aunt what's the color of her phone and she said it's green. So could this be a fake iphone phone?

    If the warranty is showing less than 12 months ,the iPhone has already been activated ,so yes most likely secondhand

  • Numerous system log errors such as: "kernel[0]: ... dyld_shared_cache_x86_64': owned by uid=89 instead of 0" ... what is the underlying problem here?

    My system.log shows numerous errors such as: "kernel[0]: ... dyld_shared_cache_x86_64': owned by uid=89 instead of 0" ...
    What is the underlying problem here?

    Are you trying to install anything by any chance??
    update_dyld_shared_cache ensures that dyld's shared cache is up-to-date. This tool is normally only run by Apple's Installer and Software Update, as they are the only official ways for OS dylibs to be updated. But if for some reason you used another mechanism to alter an OS dylib, you should manually run update_dyld_shared_cache.

  • What is the logic behind suggest due date in a planned order?

    I have observed that suggest due date of a planned order is not based on demand. What is the logic behind derivation of suggest due date?
    Some times pegging date is based on Sales Order request date but not all the times, how to interpret the pegging date of a planned order?
    Please confirm that suggest ship date is based on the suggest due date and In-transit time and lead time.

    HI,
    Planning engine calculates the Sugg Due Date based on some mathematical calculations and some Plan setups.
    It also depends on what option you have chosed in the plan, for Material availability i.e. at the start of the Job or at the start of operation.
    For buy item-it will minus the pre, post and processing lead time from the Material requirement date for making the job based on above setup.
    For make items, it will also consider Manufacturing lead time(based on the routing) and will show the Sugg due date
    Please mark this post as correct or helpful, if it clears your concern.
    Thanks,
    Avinash

  • What does the Logic Board do exactly?

    My MacBook took a little fall yesterday. I went to the Apple store and they told me that the logic board needs to be replaced, and I was curious as to what it does. I have no doubts that the genius at the store was correct, I'm just wondering what it does for future reference.

    Click here for information.
    (112473)

Maybe you are looking for

  • Messenger status indicator on a JSP page

    Greetings I would like to ask anyone, where can i find a status indicator for the most famous messengers eg. MSN, Yahoo, ICQ, IRC, Jabber. Actually there are two points i want to include to my JSP Page: 1. icons that indicate whether a user is offlin

  • Creating folders in the cloud

    Hi, it is nice to store a document in the cloud, rather than on your Mac, so that I can get it later. Matter of fact that seems to be the default storage place. Problem is, it becomes a gallery of files, none of which are organized into folders. is t

  • In MRP - Alternate Item

    Hi , As one of our client need to know whether the how we can include the  Alternate items also in MRP wizard. As we are currently in 2007b. Thanks in advanace Anand

  • Copy columns of an internal table

    hi, i want to copy columns of an internal table into another internal table, now i loop the original table to one workarea and then get the field i need, and then append to destination table. is there any more effective way ?

  • Adobe dynamic link-From after effects to Premiere

    I have few sequences save in different After effects versions because my project was to big to work with one final after effect version. I would like to use Adobe dynamic link to send all the seuqences into Adobe premiere to make a "one sequence" tha