Combining Parameters in else if statements

Hey i'm new to Java and I was having an issue with this:
else if (year1 == year2)
I want to put (day1 == day2) and (month1 == month 2) under the same "else if" as (year1 == year 2)
I thought I was supposed to use "&&" but I keep getting a syntax error. Can anyone lend me a hand and solve this example for me?

if (year1< year2)
     JOptionPane.showMessageDialog(null, name1+" is older than" +name2);
          else if (year1 > year2){
               JOptionPane.showMessageDialog(null, name2+" is older than" +name1);
               if (day1 == day2){
               } if (year1 == year2){
                    if (month1 == month2){
               JOptionPane.showMessageDialog(null, name1+"is the same age as"
               name2"!");
I'm not exactly sure where to put "}".

Similar Messages

  • Where clause with a combination of And and Or statements - Basic question

    Hi,
    I have a where clause with a combination of And and Or statements... May I know which one would run first
    Here is the sample
    WHERE SITE_NAME = 'Q' AND ET_NAME IN ('12', '15') AND TEST_DATE > DATE OR SITE_NAME = 'E' AND ET_NAME IN ('19', '20')
    can you please explain how this combination works
    Thanks in advance

    Hi,
    This reminds me of a great story. It's so good, it probably didn't really happen, but it's so good, I'm going to repeat it anyway.
    IBM once had an "executive apptitude test" that they would give to job applicants. There were some questions you might call general knowlege or trivia questions, and each question had a weight (for example, answering an unimportant queestion might score one point, an important question might be 5 points.) One of the questions was "What is the standard width of a mobile home?", and the weight of the question was -20: answering the question correctly did serious harm to your score. The reasoning was that the more you knew about mobile homes, the less likely you were to be their kind of executive.
    Now, as to your question, the correct answer is: I don't know. I don't want to know. Mixing ANDs and ORs without grouping them in parentheses is a really bad idea. Even if you get it right, it's going to confuse the next person who has to look at that code. Use parentheses to make sure the code is doing what you want it to do.
    If you really want to find out, it's documented in the SQL language manual. Look up "Operators, prcedence"
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/operators001.htm#sthref815
    You can easily do an experiment, using scott.emp, or even dual, where
    WHERE  (x AND y)
    OR      zproduces different results from
    WHERE   x
    AND     (y OR z)

  • Naming the parameters of a callable statement

    Hi!
    I am having some kind of a problem here. I am currently working on a software with a database.OK, simple.
    The problem is that we have different kind of databases (oracle, Sybase, DB2) AND different schema!
    We are obviously trying to keep the persistence layer as cut from the rest as possible.
    The problem is that in some cases, we may call a callable statement but the actual callable statement in the database is not the same as the one that would be called in a similar case with another schema.
    Therefore, we are looking for a way to set the parameters of a callable statement by a name, not an index.
    Instead of
    setString(1,"aValue");
    some
    setString("FirstParameter", "aValue");
    PLease help!
    Cheers!
    Chris

    I think there is a driver that does that.Thanks for replying so quickly, could you tell me what
    that driver would be ?Like I said I don't think it is going to help because it is for a specific data base. I you need to support more than one.
    I think it is either Oracle (if you use the Oracle specific JDBC classes - cast to them) or one of the third party drivers.
    >
    I was thinking of the wrapper too but I, as the
    (different)schemas are still changing and the callable
    statement too, I think it will be very error prone
    during the developpement cycle.
    So I'd like to avoid to have to maintain a
    "correspondance table" between each callable statement
    and it's parameters...
    And that is my idea. Developement cycles are always error prone so I am not sure that it matters.

  • Parameters in the SQL statement.

    Hi
    I am creating a PL/SQL report. The report has for example 3 columns say X,Y,Z. When i run the report, i have 2 non-mandatory parameters P1 and P2.
    My question is,
    If i enter a value in the parameter P1, then the where condition of the report should be something like
    WHERE X = P1.
    If i enter a value in the parameter P2, then the where condition of the report should be something like
    WHERE Y = P2.
    If i enter a value in both the parameters P1 and P2, then the where condition of the report should be something like
    WHERE X = P1 AND Y = P2.
    Can someone give an idea how to make this possiblie.
    Thanks
    Kumar

    You could use IF statements to accomplish the task:
    IF P1 IS NOT NULL AND P2 IS NOT NULL THEN
        SELECT ....
        FROM ....
        WHERE X = P1 AND Y = P2
    ELSIF P1 IS NULL AND P2 IS NOT NULL THEN
        SELECT ....
        FROM ....
        WHERE Y = P2
    ELSIF P1 IS NOT NULL AND P2 IS NULL THEN
        SELECT ....
        FROM ....
        WHERE X = P1
    ELSE
        SELECT ....
        FROM ....
    END IFHope this helps!

  • Currency format combined with if else issue

    Hi all,
    Basically, I need to get the value from if else statement, then use currency format to format the currency according to their currency code.
    the following is my if else statement to show the A.PAY_PROMISE_AMT or A.PROMISE_AMT
    <?xdofx:if A.PAY_PROMISE_AMT <> 0 then
    A.PAY_PROMISE_AMT
    else
    A.PROMISE_AMT
    end if?>
    <?format-currency:value_*[this value I want to use is the value from the above if else statement];*currencycode; ‘false’?>
    could anyone help me to combine those two statement to get the result I want?
    Thanks in advance

    >
    I tried your solution, but I got some error.
    >
    some?
    try change
    <>to
    !=in my sample
    what if you try IF without xdofx?
    what will be result?
    say
    <?if:A.PAY_PROMISE_AMT!=0?> <?xdoxslt:set_variable($_XDOCTX, 'LVar', A.PAY_PROMISE_AMT)?> <?end if?>
    <?if:A.PAY_PROMISE_AMT=0?> <?xdoxslt:set_variable($_XDOCTX, 'LVar', A.PROMISE_AMT)?> <?end if?>
    <?format-currency: xdoxslt:get_variable($_XDOCTX, 'LVar');CURRENCY;'true'?>plz see
    Working with xdofx:if and xdoxslt variable error

  • How to combine format number and if statement?

    Hi,
    I'm using XDO 5.6.1 under apps.
    My issue is to display a number only if it is not equal to zero.
    Otherwise, i need to display it in european mask using format_number function.
    I tried all the condition statements (if, choose) and they work perfectly.
    <?xdofx:if MAR_SUM=0 then '' else MAR_SUM end if?>
    format number works fine too.
    format-number(MAR_SUM,"### ###.00", "Euro")
    But i did not succeeded to combine if and format number
    <?xdofx:if MAR_SUM=0 then '' else format-number(MAR_SUM,"### ###.00", "Euro") end if?>
    The result is always a blank field, even MAR_SUM is not nul.
    I can not use Word format number bacause it do not work with my mask.
    Please help me, .
    Thanks.
    Pierre.

    Thanks a lot Tim,
    It helped me a lot. I'll simplify my tags using those tags.
    I have another issue concerning cell highlight.
    I have two loops in a table and when I insert <?if@row:position() mod 2=1 ?> <xsl:attribute name="background-color" xdofo:ctx="incontext">#DDDDDD</xsl:attribute>, in order to use cells highlight, my subtotals disappear at the end of my loop.
    Could I send you a email with an example, (and how to contact you)?
    Thank again for your response again.
    Regards.
    Pierre

  • Javascript popups in an if-else jsp statement

    hey there!
    i got a question...how can i get a jsp popup box in my jsp if-else statement??
    if (rs.next()) {
    String dbValue = rs.getString("Password");
    if (password.equals(dbValue)) {
         response.sendRedirect("PersonalDetails.jsp");
    else {
         //say its wrong
    else {
         //say its not found
    that is my code. the popup boxes need to say user is not found or wrong.
    thanks!

    Try this.
    <%@ page import="java.sql.*" %>
    <HTML>
    <HEAD>
    <TITLE>Graduate Application Form</TITLE>
    </HEAD>
    <%
         Connection con      =      null;
         Statement st      =      null;
         ResultSet rs      =      null;
         String strOnLoadJS = "";
         try
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              con = DriverManager.getConnection("jdbc:odbc:fypproject","","");
              st = con.createStatement();
              String email = request.getParameter("email");
              String password = request.getParameter("password");
              String query = "SELECT * FROM Login_Details WHERE Email_Address = '" + email + "'";
              rs = st.executeQuery(query);
              if (rs.next()) {
              String dbValue = rs.getString("Password");
              if (password.equals(dbValue)) {
              response.sendRedirect("PersonalDetails.jsp");
              else {
              strOnLoadJS = " onLoad=\"javascript: alert ('User / Password Mismatch');\"";
              //return false;
              else {
              strOnLoadJS = " onLoad=\"javascript: alert ('User not Found');\"";
              //return false;
    %>
    <BODY <%=strOnLoadJS%>
    </BODY>
    <%
         catch (Exception exp)
         finally
              try
                   if (rs != null)
                        rs.close ();
                   if (st != null)
                        st.close ();
                   if (con != null)
                        con.close ();
              catch (Exception exp)
    %>
    </HTML>

  • Problem with checkbox and "if" & "else if" statement

    Hi, i have got something like this:
    if (this.rawValue=="0" ){
      app.alert("0");
      this.resolveNode("Circle1").presence = "hidden";
      this.resolveNode("cross").presence = "visible";
    else if (this.rawValue=="1"){
      app.alert("1");
      this.resolveNode("Circle1").presence = "visible";
      this.resolveNode("cross").presence = "hidden";
    else{
      app.alert("2");
       this.resolveNode("Circle1").presence = "hidden";
      this.resolveNode("cross").presence = "hidden";
    I set default position on neutral state. Values are default: on=1, off=0, neutral=2.
    When i am clicking on my check box button there works only "on" (1) and "neutral" (2) state. "off" state is not working and i don`t know why.
    Please help me with that.

    Hi,
    Here is the form back to you: https://acrobat.com/#d=qiBnkcpRnPWxA5hokFXvQw.
    I have tightened the script, but that was not the main problem. The issue was that the checkbox was on the Master Page and had a default value of neutral. Some objects on the Master Page, like checkboxes with default values and buttons, can misbehave when the form is relaid out (layout:ready event).
    If you have a look at the form you will see that the objects on the Design Page behave as expected. However similar objects on the Master Page will revert to default everytime the layout:ready event fires. This has already been logged with Adobe.
    I would recommend moving the objects to a Design Page or maybe use a dropdown instead of the checkbox.
    Niall

  • SQL Expression Field - Combine Declared Variable With Case Statement

    Hello All, I have been using Crystal & Business Objects for a few months now and have figured out quite a bit on my own. This is the first real time I have struggled with something and while I could do this as a Formula Field I would like to know how to do this as a SQL Expression. Basically I want to create a SQL Expression that uses a CASE statement but I wanted to make the code a little more efficient and employ a variable to hold a string and then use the variable in the CASE statement. The expression editor accepts the CASE statement OK but I don't know how to declare the variable. Please assist with the syntax?
    This is what I have:
    CASE
       WHEN u201CDatabaseu201D.u201DFieldu201D = u2018Hu2019 THEN u2018Hedgeu2019
       WHEN u201CDatabaseu201D.u201DFieldu201D = u2018Pu2019 THEN u2018PVIu2019
       ELSE u2018Noneu2019
    END
    This is what I want:
    DECLARE strVar AS VARCHAR(25)
    strVar =  u201CDatabaseu201D.u201DFieldu201D
    CASE
       WHEN strVar = u2018Hu2019 THEN u2018Hedgeu2019
       WHEN strVar = u2018Pu2019 THEN u2018PVIu2019
       ELSE u2018Noneu2019
    END

    Hi Todd,
    Please use the following for loop; your problem will be solved.
    Local StringVar str := "";
    Local NumberVar strLen := Length ({Database.Field});
    Local NumberVar i;
    For i := 1 To strLen Do
           if {Database.Field} <i> = "H" then str := "Hedge"
            else if {Database.Field} <i> = "P" then str := "PVI"
            else str := "None"; exit for
    str
    Let me know once done!
    Thank you,
    Ashok

  • How to describe placeholder/parameters in a SQL statement

    Hi
    Does anybody know how to describe the placeholder/parameters in a statement? I only find the OCI documentation talking about "Describing Select-list Items". But what if I want to retrieve the data type of a placeholder (assuming I don't know beforehand or just want the program to be more flexible)? Doing this by describing schema metadata first (have to find out which schema object to use) and then using OCIDescribeAny() seems not a very good way. Thanks.

    Jonah, and others,
    how would you find out the (hash_value, address) of the statement just described to extract the statement-relevant information from V$SQL_BIND_CAPTURE?
    Via a join with V$SQL and the statement's text?
    Thanks, --DD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • If elseif else echo statement with radio buttons

    Hi everyone  Please help me out here.  I have a standard php file with 4 groups of questions (radio groups). The user must answer "yes" to ALL 4 questions where after "You Qualify" will echo on the same page.  If any of the questions are answered "No" to, then "you do not qualify" must echo on the same page. If no answer is selected - then no echo  This sounds like a simple if elseif else  statement, but for some reason I just cant get it right.  Could anyone please help me out with this?  Herewith code that I have tried:
    Do you like apples?        Yes           No 
    Do you like oranges?
            Yes           No 
    Do you like pears?
         Yes      No
    Do you like lemons?
         Yes      No

    <?php
    if ($a > $b) {
        echo "a is bigger than b";
    } elseif ($a == $b) {
        echo "a is equal to b";
    } else {
        echo "a is smaller than b";
    ?>

  • Any way to compress these else if statements?

    Hey guys. i have a button that draws a graph once pushed. The button works perfect draws a graph in a jpanel all is good. My question though, is there a way to compress the if/else statements so there arnt so many? Just seems it is taking up alot of lines.
    private JButton getJButton_Draw() {
              if (jButton_Draw == null) {
                   jButton_Draw = new JButton();
                   jButton_Draw.setBounds(new Rectangle(15, 525, 137, 31));
                   jButton_Draw.setText("DRAW");
                   jButton_Draw.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             // Get values from the text fields
                            Wk1 = Integer.parseInt(jTextField_Wk1.getText());
                             Wk2 = Integer.parseInt(jTextField_Wk2.getText());
                             Wk3 = Integer.parseInt(jTextField_Wk3.getText());
                            Wk4 = Integer.parseInt(jTextField_Wk4.getText());
                             Wk5 = Integer.parseInt(jTextField_Wk5.getText());
                             Wk6 = Integer.parseInt(jTextField_Wk6.getText());     
                             iaName = jTextField_Artist.getText();
                            isName = jTextField_Song.getText();
                            // Sets the label for who sings and and what's the song name
                            jLabel_artistNameSong.setText("Chart for " + isName + " by " + iaName );
                             if(!jRadioButton_Line.isSelected())
                             iY = ((Wk1 * 15) - 5);
                             iX = (1 * 45) -5;
                             jPanel_drawingArea.paint(jPanel_drawingArea.getGraphics());
                             iY = ((Wk2 * 15) - 5);
                             iX = (2 * 45) -5;
                             jPanel_drawingArea.paint(jPanel_drawingArea.getGraphics());
                             iY = ((Wk3 * 15) - 5);
                             iX = (3 * 45) -5;          
                             jPanel_drawingArea.paint(jPanel_drawingArea.getGraphics());
                             iY = ((Wk4 * 15) - 5);
                             iX = (4 * 45) -5;                         
                             jPanel_drawingArea.paint(jPanel_drawingArea.getGraphics());
                             iY = ((Wk5 * 15) - 5);
                             iX = (5 * 45) -5;
                             jPanel_drawingArea.paint(jPanel_drawingArea.getGraphics());
                             iY = ((Wk6 * 15) - 5);
                             iX = (6 * 45) -5;
                             jPanel_drawingArea.paint(jPanel_drawingArea.getGraphics());
                             else{
                                  iY = ((Wk1 * 15) - 5);
                                  iX = (1 * 45) -5;
                                  iPrevY = ((Wk1 * 15) - 5);
                                  iPrevX = 0;
                                  jPanel_drawingArea.paint(jPanel_drawingArea.getGraphics());
                                  iY = ((Wk2 * 15) - 5);
                                  iX = (2 * 45) -5;
                                  iPrevY = ((Wk1 * 15) - 5);
                                  iPrevX = (1 * 45) -5;
                                  jPanel_drawingArea.paint(jPanel_drawingArea.getGraphics());
                                  iY = ((Wk3 * 15) - 5);
                                  iX = (3 * 45) -5;
                                  iPrevY = ((Wk2 * 15) - 5);
                                  iPrevX = (2 * 45) -5;
                                  jPanel_drawingArea.paint(jPanel_drawingArea.getGraphics());
                                  iY = ((Wk4 * 15) - 5);
                                  iX = (4 * 45) -5;
                                  iPrevY = ((Wk3 * 15) - 5);
                                  iPrevX = (3 * 45) -5;
                                  jPanel_drawingArea.paint(jPanel_drawingArea.getGraphics());
                                  iY = ((Wk5 * 15) - 5);
                                  iX = (5 * 45) -5;
                                  iPrevY = ((Wk4 * 15) - 5);
                                  iPrevX = (4 * 45) -5;
                                  jPanel_drawingArea.paint(jPanel_drawingArea.getGraphics());
                                  iY = ((Wk6 * 15) - 5);
                                  iX = (6 * 45) -5;
                                  iPrevY = ((Wk5 * 15) - 5);
                                  iPrevX = (5 * 45) -5;
                                  jPanel_drawingArea.paint(jPanel_drawingArea.getGraphics());
              return jButton_Draw;
         }PS, the Wk1 and wk4 poor alignment is only in this code i pasted it in but it seems to have lost its spot..
    Edited by: Darryl Burke -- removed the long comment to its own line as it was breaking the forum formatting in some browsers

    Your main question:
    My question though, is there a way to compress the if/else statements so there arnt so many? Just seems it is taking up alot of lines.I see only one "if/else" statement here. Do you mean there are too many statements in each clause? Then as advised already, extract that into dedicated methods. A good informal rule of thumb is that a method's body should fit entirely on your code editor window. If it doesn't, you can't grasp the whole method's work in one look, and you'd better split it into several shorter methods (and the small methods are more likely to be reusable too).
    Side-point (but much more important):
    Hey guys. i have a button that draws a graph once pushed. The button works perfect draws a graph in a jpanel all is good.No all isn't that good.
    This is not how you're supposed to "draw something on panel". It works now but is an unusual construct, so may prove hard to maintain, and doesn't integrate well with the repaint mechanism (e.g. try to mask the panel behind another window (say, the system clock window), then remove the obscuring window.
    Plus, it won't integrate well with other Swing features (threading, drag and drop,...).
    The recommended way to paint things on a JPanel is to design a custom JPanel subclass and override paintComponent(). See the tutorial on [url http://download.oracle.com/javase/tutorial/uiswing/painting/index.html]Custom painting.
    A good rule of thumb is "never use +getGraphics()+, and never invoke any +paint()+ method directly.

  • If/Else/Then statement in Bex

    Hi all,
    I want to create some conditional logic in Bex formula. The logic I need is:
    IF (KeyFigA exists) THEN (use KeyFigA) ELSE IF (KeyFigB exists) THEN (use KeyFigB) ELSE (use KeyFigC)
    I am a bit confused on the operators I need to use...Can anyone help?
    Thanks
    CM

    Hi,
    ( KFA <> 0 ) * KFA + (KFA == 0 ) * (KFB <> 0 ) * KFB + ( KFA == 0 ) * ( KFB == 0 ) * KFC
    Just as Bob said, however, you need to use the <> symbols for .NE..  You can also select the symbols in the Boolean Logic section.
    Brian
    I think I know why Bob added the .NE., even though I can see them in my edit screen, they are not showing up in the message after I save it.
    Edited by: Brian Anthony on Oct 20, 2008 4:39 PM

  • Query Question: Combine outer join with max() statement

    Hi Folks,
    I have been banging my head on this for a while now and am asking from some advice.
    I have a Project Completion Report that pulls information from a number of tables:
    1) Program (PK: ID)
    2) Project (PK: ID, FK: Program_ID constrained to Program.ID)
    3) Project_Monthly (PK: ID, FK: Project_ID constrained to Project.ID)
    4) Status_Report (PK: ID, FK: Project_ID constrained to Project.ID)
    The Status_Report table has a Record_Date field and holds a BLOB with the status reports for all the projects. In the best of all possible worlds, every project would have a status report, but, obviously, some have no status reports.
    I have been asked to extend the Project Completion Report. It currently shows:
    1) Program Number (Program.Program_Number)
    2) Program Name (Program.Program_Name)
    3) Project (Project.Project_Name)
    4) Projected Completion Date (Project_Monthly.Current_Date_Production)
    We would like to add the latest status report. So I started with something that works in another report, which is to get the ID from the Status_Report table for the record that has the maximum date value in the Record_date that matches the Project in the current Program. But this other query is looking at one program at a time. The Project Completion Report is showing all programs with projects that complete within a certain time frame.
    The requirement is to show all projects that will complete within a time frame and to display the ID of the most recent status report (I use javascript to turn this into a downloadable link). However, whenever I try something like:
    AND Status_Report.Record_Date =
    (select MAX(Status_Report.record_date) from Status_Report
    where Status_Report.ID = Project.ID)I loose all projects that have no status reports associated with them.
    How can I keep all the projects that fulfill the criteria of completing within a specified time frame and add the ID, if it exists, of the most recent status report?
    I thank you for your time and assistance. Please let me know how I can clarify the problem more clearly.
    Yours,
    Petie

    I had thought I finally solved it. Alas, it wasn't yet to be.
    I created a view with the following select statement:
    select p.program_number, p.program_name,
    pj.id as pj_id, pj.project_name, pjm.in_prod_current, pjm.record_date as pjm_record_date,
    prs.id as prs_ID, prs.record_date as prs_record_date
    from program p, project pj, project_monthly pjm,
    project_status_report prs
    where p.id = pj.program_id
    and pj.id = pjm.project_id
    and pj.id = prs.project_id (+);Then, I selected from the view and the project_status_report table, performed an outer join on those (filtered to only the current month's project records) and filtered by the maximum date for each project.
    Here is the resulting query:
    select pc.program_number, pc.pj_id, pc.project_name, pc.in_prod_current,
    pc.pjm_record_date, pc.prs_id
    from project_completion pc,
    project_status_report prs
    where trunc(pjm_record_date, 'mon') = trunc(sysdate,'mon')
    and prs.id = pc.prs_id (+)
    and pc.prs_record_date =
    (select max(mprs.record_date)
    from project_status_report mprs
    where mprs.project_id = pc.pj_id)However, I am still not getting the projects for which there are no status reports.
    Verflixt und zugenaeht!
    It seems that I want to compare based upon the record_date of the status report, but get the ID back. Can I use DECODE for that? Can I get the MAX(prs.record_date), but return only the prs.ID? Because if I include the ID in the select statement, I get too many matches, but if I don't then I don't have the ID, which is needed.
    Any suggestions?
    Thanks, Petie
    Message was edited by:
    Petie

  • If else conditional statements for dynamic text fields (as 2.0)

    This is about a self assesment quiz.There will be four options and each one has a scale from1-5 ie "option a" has 1mark, "option b" has 2marks,"option c" has 3 marks, "option d" has 4marks and "option e" has 5 marks and we count the answerd and we display the scor for example if there are 20 question in it if they answered "option e" 5 times the score will be
    25 and option d 5 times the score will be 20,anf if "option c" for 5 times the score will be 15,and "option b" for 3 times  the score will be 6 and "option a" two times the score will be 2, and we add up all the score and display in a dynamic text field called "scor" and the total score is 68.And i have another dynamic text field called "tsc" where i have to display the tags like excellent , good, better ......ect.
    Till now every thing is fine but i am unable to compare them it is displaying excellent even if i get 10 marks, i am unable to configure where i am going wrong.
    If the score is greater than 55 "tsc" should display Excellent, if the score is greater than 41 or less than 55 "tsc" should display Best, if the score is greater than 26 or less than 40 "tsc" should display Better,if the score is none of the above "tsc" should display Poor.
    This is my code on the submit button:
    on (release) {
        gotoAndStop("sQ");
        if (scor>=55) {
            tsc = "Excellent";
        } else if (scor == 41 && scor<=55) {
            tsc = "Best";
        } else if (scor == 26 && scor<=40) {
            tsc = "Better";
        } else if (scor == 10 && scor<=25) {
            tsc = "Good";
        } else {
            tsc = "Poor";
    where:
    "sQ" is the frame name where i am displaying the score details
    "scor" is the var name for the dynamic text field for displaying total score
    "tsc" is the var name for the dynamic text field for displaying the tags llike good, Excellent, better, poor.....etc
    Plese help.......

    Use trace commands to make sure that what you think you are processing is what is actually hapenning.
    Your middle conditionals are not written as you described them... any "==" should be ">="
    It is recommended you get away from using the textfield var option... it can be troublesome to work with.  Just assign an instance name to the textfield and assign the values to its text property... for instance, say you name it tscField, then you would use tscField.text = "Excellent";
    Also, realize that the gotoAndStop command will not happen until after all the code executes in case that matters
    on (release) {
        gotoAndStop("sQ");
        trace(scor);
        if (scor>=55) {
            tsc = "Excellent";
        } else if (scor >= 41 && scor<=55) {
            tsc = "Best";
        } else if (scor >= 26 && scor<=40) {
            tsc = "Better";
        } else if (scor >= 10 && scor<=25) {
            tsc = "Good";
        } else {
            tsc = "Poor";

Maybe you are looking for