Syntax error...but i just cant find it!

Hi could someone please tell me what is wrong with this syntax
It is supposed to check if the date entered is greater than seven days time
and then check if the apptdate and appttime are already taken in the database
Thanks
<%@ page language="java"import="java.sql.*, java.io.*, java.util.*, java.text.*, connection.*"%>
<jsp:useBean id="appt" class="connection.appointment" />
<html>
<head>
<title>Appointment Booked</title>
</head>
<body>
<%
try
appt.connect();
     java.util.Date today = new java.util.Date();
     String date = request.getParameter("apptdate");
     int time = Integer.parseInt(request.getParameter("appttime"));
     Calendar cal = Calendar.getInstance();
if (cal.add(Calender.DATE, 7));
          out.print("You can only book up to seven days in advanced");
if ((appt.equals.("apptdate")&&(appt.equals.("appttime"))))
%>
<p><b><font size="4">Unable to book Appointment please choose another, date and time!</font></b></p>
<%
     int apptNo = Integer.parseInt(request.getParameter("apptNo"));
     int doctorNo = Integer.parseInt(request.getParameter("doctorNo"));
     int patient_userID = Integer.parseInt(request.getParameter("patient_userID"));
     appt.BookAppointment(apptNo, doctorNo, time, date, patient_userID);
     appt.disconnect();
     out.print("Your Appointment has been booked!");
} catch(Exception e)
     out.print("You have entered an invalid date! Please retry.");
%>
</body>
</html>
All help gratefully received

if u want to check if the entered date in greater than seven days time, try the code below..
assuming u get the date in "mm/dd/yy" format...
      SimpleDateFormat df = new SimpleDateFormat("MM/dd/yy");
      Date enteredDate = df.parse(request.getParameter("apptdate")); 
      Calendar cal = Calendar.getInstance();
      cal.add(Calendar.DATE, 7);
      Date after7days = cal.getTime();
      if( enteredDate .after(after7days))
          out.print("You can only book up to seven days in advanced");

Similar Messages

  • Hi, I am new to iPhone and downloaded a app from the app store and had my iPhone connected to my computer but I just cant find the app on my phone I'v checked on the desktop and the app store but it is nowhere...can somebody point me in the right directio

    Hi, I am new to iPhone and downloaded a app from the app store and had my iPhone connected to my computer but I just cant find the app on my phone I'v checked on the desktop and the app store but it is nowhere...can somebody point me in the right direction plzzzzz

    If your iPhone is not recognized by iTunes when connected - not available under Devices in the iTunes source list, check this link.
    http://support.apple.com/kb/TS1538?viewlocale=en_US&locale=en_US
    For voice memos, I have include voice memos when syncing selected under the Music tab for my iPhone sync preferences with iTunes which transfers voice memos from my iPhone to my iTunes library when syncing.

  • I have Old Firefox Data folder before i formated my laptop . but i just cant find how to use this folder for my new firefox to regain all the bookmarks i had.

    I had some issue with my Firefox (it crashes when i starts), so i format my laptop to factory setting and now i got new Firefox installed and left with this Old Firefox Data folder.
    my question is :
    Ii understand the profile in my Old Firefox Data contains my Bookmarks and information i previously had before i formatted, i just do not know how to apply this Old Firefox Data to my new Firefox to get what i need.
    How do i use Old Firefox Data to restore all my bookmarks and information?

    You can move some files from the "Old Firefox Data" folder to the current Firefox profile folder.
    *https://support.mozilla.org/kb/Recovering+important+data+from+an+old+profile
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder)
    It is best to only copy what you need and avoid copying the full profile content.

  • I have photoshop C6 on my MAC Pro and want to install it on my new MAC desktop.  I sent the files with AirDrop but photoshop wont open I get an error message that it cant find the Library.  Any thoughts?

    I have photoshop C6 on my MAC Pro and want to install it on my new MAC desktop.  I sent the files with AirDrop but photoshop wont open I get an error message that it cant find the Library.  Any thoughts?

    download the installation files and install using your serial number or adobe id,
    Downloads available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  12 | 11, 10 | 9,8,7
    Lightroom:  5.5 (win), 5.5 (mac) | 5.4 (win), 5.4 (mac) | 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • I just exported an imovie movie but now i cant find it on my imac

    it took 3 hours to export but now i cant find it anywhere on my imac

    Hey,
    What I would do is open up the export window again as if you are going to export the movie and see where the location is set to export the video. Then go find it on your computer. I hope that makes sense.
    The iMovie Guy

  • I downloaded premier- but now I cant find it in my apps- I uninstalled the old trial version, where

    I downloaded premier- but now I cant find it in my apps- I uninstalled the old trial version, where is the new version I just downloaded?

    Doing a factory reset will delete your Firefox install. Even if you move the app to the sdcard.

  • I remember once i added a addon which continues a web page of a forum if it has 10 pages automatically with out clicking it but now i cant find it?

    i remember once i added a addon which continues a web page of a forum if it has 10 pages automatically with out clicking it but now i cant find it?

    Ouch, tough spot, but offhand I'd say some memory may have gone bad, or maybe just needs re-seating after all this time.
    Not much you can do, but try this anyway...
    PRAM reset, CMD+Option+p+r...
    http://support.apple.com/kb/ht1379
    In fact, do 3 in a row, takes a bit of time.

  • How do you purchase a ringtone? i have enabled 'ringtones' in the 'general' section of itunes preferences and i am connected to the internet but i just cant see where in the itunes store to click once i am at the song i want to turn into a ringtone. help!

    how do you purchase a ringtone? i have enabled 'ringtones' in the 'general' section of itunes preferences and i am connected to the internet but i just cant see where in the itunes store to click once i am at the song i want to turn into a ringtone. help!

    You don't
    You have to create a ringtones.  Google will find several ways to do this.
    I use Garageband.
    How to create custom ringtones in GarageBand 4.1.1
    You can also use itunes:
    Make free iPhone ringtones in iTunes 10

  • Hi. I am trying to use Bridge to make web galleries. There used to be something on PS for that but now I cant find it in PS so I was advised to use Bridge.  However, there is something called Output Module (AOM) that is missing from my Bridge.  I download

    Hi. I am trying to use Bridge to make web galleries. There used to be something on PS for that but now I cant find it in PS so I was advised to use Bridge.  However, there is something called Output Module (AOM) that is missing from my Bridge.  I downloaded this.  The instructions say :Copy the Adobe Output Module folder (not the AOM_Package_[OS] folder) into the Bridge CC Extensions folder in the appropriate location: 
    Windows: C:\Program Files\Common Files\Adobe\Bridge CC Extensions
    Mac OS: /Library/Application Support/Adobe/Bridge CC Extensions.  However there is noplace on my Macbook Air running Yosemetie that has this /Library/Applications SUpport/Bridge CC Extensions. Can anyone advise?

    That file could be set as a Launch Agent or Daemon in your ~/Library or /Library, You could try to look for it or Safeboot your computer and then empty the trash. Safebooting disables Launch Agents/Daemon and Third Party Kernal extensions. Here's the article to Safeboot OS X: What is Safe Boot, Safe Mode? - Apple Support

  • My itunes wont sync my ipod touch, when i click sync it says that it is syncing but it wont sync, im sorry but i just cant exacly explain it

    My itunes wont sync my ipod touch, when i click sync it says that it is syncing but it wont sync, im sorry but i just cant exacly explain it

    It sounds like you need to set it up, and that makes sense because you said that its a new iPod. Just go through the steps of setting up a new iPod and you should be good.

  • I downloaded the free trial for Adobe XI Pro but now I cant find it on my computer or figure out how to use it. The only thing I see that downloaded is Adobe Download Assistant. How can I access the program?

    I downloaded the free trial for Adobe XI Pro but now I cant find it on my computer or figure out how to use it. The only thing I see that downloaded is Adobe Download Assistant. How can I access the program?

    Assistanttolindsey the Adobe Download Assistant will download the installation files for Adobe Acrobat Professional XI.  By default they are saved to your download folder.  You can begin the installation process from there.

  • I'v been trying to put a video from my laptop to my iphone for soo long now but i just cant, it wont let me put my video onto itunes but it just wont let me

    I'v been trying to put a video from my laptop to my iphone for soo long now but i just cant, it wont let me put my video onto itunes but it just wont let me, i'm going crazy please help

    well, the video is probably in a format that iTunes doesn't recognize.  Convert it using an application like Handbrake.

  • HT4623 what if your iphone says an error has occured and cant find a update?

    I have a friend that has a iphone 4s and she cant update to ios7 it keeps telling her that an error occured and it cant find a update

    dtrain1088 wrote:
    .. i have enough space for the update
    Are you sure..? If so... Do the Update using iTunes on your Computer.
    See the Using iTunes Section Here...
    How to update your iPhone, iPad, or iPod touch

  • Syntax error but I'm too blind to see...

    Using the below SQL from my usrStartFrm.ASP page to ORA 8i I have set a page variable = a session variable
    +++++++++++++++++++++++
    dim usrLoginID
    SUB usrStartFrm_onenter()
         usrLoginID = Session("LoginID")
    End SUB
    +++++++++++++++++++++++++
    But I cannot return records using the following syntax.
    SELECT DISTINCT
    L.LOGINID,
    B.BUSINESSSEGMENTNAME
    FROM SODA.ASSIGNMENTS_TB A,
    SODA.LOGINS_TB L,
    SODA.BUSSEGMENT_TB B
    WHERE A.FK_LOGIN_NO = L.LOGIN_NO
    AND
    A.FK_BUSSEGID = B.BUSSEGID AND
    (L.LOGINID = '" & usrLoginID &" ')
    ORDER BY B.BUSINESSSEGMENTNAME
    NOR DOES THIS
    ++++++++++++++++++++++++++++++++++++++++++++++++
    (L.LOGINID = '" & Session("LoginID") &" ')
    +++++++++++++++++++++++++++++++++++++++++++++++++
    BUT if I change the sytax to a hard code
    (L.LOGINID = 'ajgrasso')
    The query works.
    I know the page creates the variable because I print it out to the p;age as it loads..
    SO I figure it must be the bugaboo string single double qutes issue.
    Any Ideas.
    Thanks beforehand
    AJ

    It does help somewhat to see the complete code. I can now see and understand how you are building your select statement including your variable and storing the select statement to another variable to be executed. Unfortunately, I don't know enough about ASP and javascript and so forth to be certain of the correct code. However, I can see a lot of similarities between what you are doing and how we build a select statement in PL/SQL and store it to a variable for dynamic execution. There are various ways of including variables within that select statement. About the best I can do is offer various legitimate syntaxes in PL/SQL and hope that you can see the similarities and will be able to adapt one or more of them. In each of the examples below, which demonstrate slightly different methods, I have used current_user for the Oracle user, but you can substitute os_user for current_user in any of them if you want the operating system user. However, note that it will include the domain, like your_domain\ajgrasso so you may need to do some parsing for proper comparison. If you don't get any errors, but it also doesn't return any rows, it might be due to something like that. Notice that, when building a select statement and storing it to a variable, all single quotes within the string must be doubled. That is, replace each single quote with two single quotes (not double quotes) within the string. Also, in Oracle, || is the concatenation symbol, not &. However, because you are using ASP and javascript, if they require double quotes and &, then you may have to experiment with such substitutions. Please see what you can derive from the following and let us know. Also, if it doesn't work for you, please be specific as to whether it returns an error message or if it just doesn't return any rows. A cut and paste of the run, as I have done below, would help.
    SQL> -- test tables and data:
    SQL> SELECT * FROM scott.assignments_tb
      2  /
    FK_LOGIN_NO FK_BUSSEGID                                                        
              1           1                                                        
    SQL> SELECT * FROM scott.logins_tb
      2  /
      LOGIN_NO LOGINID                                                             
             1 SCOTT                                                               
    SQL> SELECT * FROM scott.bussegment_tb
      2  /
      BUSSEGID BUSINESSSEGMENTNAME                                                 
             1 SCOTT bussegname                                                    
    SQL>
    SQL>
    SQL> -- code samples using scott schema
    SQL> -- instead of soda schema:
    SQL>
    SQL>
    SQL> CREATE OR REPLACE PACKAGE types_pkg
      2  AS
      3    TYPE weak_ref_cursor_type IS REF CURSOR;
      4  END types_pkg;
      5  /
    Package created.
    SQL>
    SQL>
    SQL> CREATE OR REPLACE PROCEDURE test_procedure
      2    (p_weak_ref_cursor OUT types_pkg.weak_ref_cursor_type)
      3  AS
      4    CommandText VARCHAR2 (4000);
      5  BEGIN
      6    CommandText :=
      7    'SELECT      DISTINCT
      8             l.loginid,
      9             b.businesssegmentname
    10       FROM      scott.assignments_tb a,
    11             scott.logins_tb      l,
    12             scott.bussegment_tb  b
    13       WHERE      a.fk_login_no = l.login_no
    14       AND      a.fk_bussegid = b.bussegid
    15       AND      (l.loginid = SYS_CONTEXT (''USERENV'', ''CURRENT_USER''))
    16       ORDER BY b.businesssegmentname';
    17 
    18    OPEN p_weak_ref_cursor FOR CommandText;
    19  END test_procedure;
    20  /
    Procedure created.
    SQL> SHOW ERRORS
    No errors.
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXECUTE test_procedure (:g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    LOGINID                        BUSINESSSEGMENTNAME                             
    SCOTT                          SCOTT bussegname                                
    SQL>
    SQL>
    SQL> CREATE OR REPLACE PROCEDURE test_procedure
      2    (p_weak_ref_cursor OUT types_pkg.weak_ref_cursor_type)
      3  AS
      4    CommandText VARCHAR2 (4000);
      5  BEGIN
      6    CommandText :=
      7    'SELECT      DISTINCT
      8             l.loginid,
      9             b.businesssegmentname
    10       FROM      scott.assignments_tb a,
    11             scott.logins_tb      l,
    12             scott.bussegment_tb  b
    13       WHERE      a.fk_login_no = l.login_no
    14       AND      a.fk_bussegid = b.bussegid
    15       AND      (l.loginid = ' || 'SYS_CONTEXT (''USERENV'', ''CURRENT_USER'')' || ')
    16       ORDER BY b.businesssegmentname';
    17 
    18    OPEN p_weak_ref_cursor FOR CommandText;
    19  END test_procedure;
    20  /
    Procedure created.
    SQL> SHOW ERRORS
    No errors.
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXECUTE test_procedure (:g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    LOGINID                        BUSINESSSEGMENTNAME                             
    SCOTT                          SCOTT bussegname                                
    SQL>
    SQL>
    SQL> CREATE OR REPLACE PROCEDURE test_procedure
      2    (p_weak_ref_cursor OUT types_pkg.weak_ref_cursor_type)
      3  AS
      4    usrLoginID  VARCHAR2 (30);
      5    CommandText VARCHAR2 (4000);
      6  BEGIN
      7    usrLoginID := SYS_CONTEXT ('USERENV', 'CURRENT_USER');
      8 
      9    CommandText :=
    10    'SELECT      DISTINCT
    11             l.loginid,
    12             b.businesssegmentname
    13       FROM      scott.assignments_tb a,
    14             scott.logins_tb      l,
    15             scott.bussegment_tb  b
    16       WHERE      a.fk_login_no = l.login_no
    17       AND      a.fk_bussegid = b.bussegid
    18       AND      (l.loginid = ''' || usrLoginID || ''')
    19       ORDER BY b.businesssegmentname';
    20 
    21    OPEN p_weak_ref_cursor FOR CommandText;
    22  END test_procedure;
    23  /
    Procedure created.
    SQL> SHOW ERRORS
    No errors.
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXECUTE test_procedure (:g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    LOGINID                        BUSINESSSEGMENTNAME                             
    SCOTT                          SCOTT bussegname                                
    SQL>
    SQL>
    SQL> CREATE OR REPLACE PROCEDURE test_procedure
      2    (p_weak_ref_cursor OUT types_pkg.weak_ref_cursor_type)
      3  AS
      4    usrLoginID  VARCHAR2 (30);
      5    CommandText VARCHAR2 (4000);
      6  BEGIN
      7    usrLoginID := SYS_CONTEXT ('USERENV', 'CURRENT_USER');
      8 
      9    CommandText :=
    10    'SELECT      DISTINCT
    11             l.loginid,
    12             b.businesssegmentname
    13       FROM      scott.assignments_tb a,
    14             scott.logins_tb      l,
    15             scott.bussegment_tb  b
    16       WHERE      a.fk_login_no = l.login_no
    17       AND      a.fk_bussegid = b.bussegid
    18       AND      (l.loginid = :usrLoginID)
    19       ORDER BY b.businesssegmentname';
    20 
    21    OPEN p_weak_ref_cursor FOR CommandText USING usrLoginID;
    22  END test_procedure;
    23  /
    Procedure created.
    SQL> SHOW ERRORS
    No errors.
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXECUTE test_procedure (:g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    LOGINID                        BUSINESSSEGMENTNAME                             
    SCOTT                          SCOTT bussegname                                
    SQL>
    SQL>
    SQL> CREATE OR REPLACE PROCEDURE test_procedure
      2    (p_weak_ref_cursor OUT types_pkg.weak_ref_cursor_type,
      3       usrLoginID       IN  VARCHAR2)
      4  AS
      5    CommandText VARCHAR2 (4000);
      6  BEGIN
      7    CommandText :=
      8    'SELECT      DISTINCT
      9             l.loginid,
    10             b.businesssegmentname
    11       FROM      scott.assignments_tb a,
    12             scott.logins_tb      l,
    13             scott.bussegment_tb  b
    14       WHERE      a.fk_login_no = l.login_no
    15       AND      a.fk_bussegid = b.bussegid
    16       AND      (l.loginid = :usrLoginID)
    17       ORDER BY b.businesssegmentname';
    18 
    19    OPEN p_weak_ref_cursor FOR CommandText USING usrLoginID;
    20  END test_procedure;
    21  /
    Procedure created.
    SQL> SHOW ERRORS
    No errors.
    SQL> VARIABLE g_ref REFCURSOR
    SQL> VARIABLE usrLoginID VARCHAR2(30)
    SQL> EXECUTE :usrLoginID := SYS_CONTEXT ('USERENV', 'CURRENT_USER')
    PL/SQL procedure successfully completed.
    SQL> EXECUTE test_procedure (:g_ref, :usrLoginID)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    LOGINID                        BUSINESSSEGMENTNAME                             
    SCOTT                          SCOTT bussegname                                

  • Grub error - but booting just fine

    I recently got an SSD.  I moved my Arch setup to it, turned on "discard" in fstab, wiped my grub config (I might've even wiped my entire /boot folder but I don't remember - I've been dealing with this problem for about a month), reinstalled grub from pacman, and used os-prober to assist in re-building grub.cfg.
    For some strange reason though, just before grub loads I seem to get 3 errors all saying the same thing - "File not found".  It doesn't tell me anything other than that.  When Arch is then selected from the boot menu, it re-states those 3 errors and says "Press any key to continue".  Pressing any key doesn't seem to do anything, it just sits there for about 5 seconds, and then proceeds to boot normally as though nothing happened.
    I would love to give more in-depth details as to what's wrong, but this is all I can provide.  Currently I am not using grub to boot anything else - just Arch.

    I get these three alerts on another box which dont run arch, id hazard a guess its grub not erroring but merely alerting you, IDK what the 3 missing files are, but i do know its not errors. I think its grub looking for certain files  (maybe hardware specific files) and if they arent found grub continues to boot.  This wont cause you any ill effects.

Maybe you are looking for