Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Posts
    7

    Unanswered: help with syntax

    I am trying to construct a statement like this to get data form a MYSQL database.

    it doesn't seem to be getting the values. It just brings out all the data.
    I am passing the values 'dateStart' and 'dateEnd' derived from an user input from field.
    --------

    String sql = "select login_id, fullname, email, expires_dtime"
    + " from loginpw"
    + " where expires_dtime >= "
    + dateStart + " <= " + dateEnd ;
    Result result = csuser.execute(csuser.newStatement(sql));

    --------------

    if I try where expires_dtime >= 'date' and expires_dtime <= 'date' ;

    it throws an sql error.

  2. #2
    Join Date
    Sep 2002
    Location
    Montreal, Canada
    Posts
    224
    Provided Answers: 1

    Re: help with syntax

    Originally posted by bobwilli
    I am trying to construct a statement like this to get data form a MYSQL database.

    it doesn't seem to be getting the values. It just brings out all the data.
    I am passing the values 'dateStart' and 'dateEnd' derived from an user input from field.
    --------

    String sql = "select login_id, fullname, email, expires_dtime"
    + " from loginpw"
    + " where expires_dtime >= "
    + dateStart + " <= " + dateEnd ;
    Result result = csuser.execute(csuser.newStatement(sql));

    --------------

    if I try where expires_dtime >= 'date' and expires_dtime <= 'date' ;

    it throws an sql error.
    Whic error?
    Have you tried the final SQL statement from the MySQL client?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •