Jump to content

shaf

Members
  • Posts

    1
  • Joined

  • Last visited

shaf's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. shaf

    need help please

    I have table customer in which, one of the columns is start_Date of data type Date. I've tried running it but no rows were selected. I wonder if it is because my queries were wrong.So here, I wanted to create a monthly and yearly report which takes input("month" and "year") from the user. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ String year = request.getParameter("year"); String month = request.getParameter("month");String query = "SELECT EXTRACT(YEAR FROM start_Date) AS start_Year," + "EXTRACT(MONTH FROM start_Date) AS start_Month, " + "FROM customer"; statement = con.createStatement(); ResultSet result = statement.executeQuery(query); while (result.next()) { String query4 = "SELECT * FROM customer WHERE status_Order='Paid'" + ",start_Month='" +month+ "' AND start_Year='" +year+ "'"; statement4 = con4.createStatement(); ResultSet rs4 = statement4.executeQuery(query4);
×
×
  • Create New...