account_id current_balance open_date 1 100 2012-03-01 2 100 2012-4-01 3 100 2013-03-1
SQLワークベンチでクエリを実行しているときは問題ありません
select count(acc.account_id)
from daily_account acc
where acc.opening_date < '2013-03-01'
しかし、これを NetBeans で実行すると、適切な出力が得られません。
select count(acc.account_id)
from daily_account acc
where acc.opening_date < '"+ new Date((Integer.parseInt(FromYearComboBox.getSelectedItem().toString())-1900),FromMonthComboBox.getSelectedIndex(),Integer.parseInt(FromDateComboBox.getSelectedItem().toString()))).toString()
なぜこれが起こっているのですか?
編集 :
rs = st.executeQuery("select count(acc.account_id) from daily_account
acc where acc.opening_date < '"+ new
Date((Integer.parseInt(FromYearComboBox.getSelectedItem().toString())-1900),FromMonthComboBox.getSelectedIndex(),(Integer.parseInt(FromDateComboBox.getSelectedItem().toString()))).toString()+"';");
rs.next();
tabledata[0][2]=rs.getString(1);
編集::間違った答えが返ってきました...すべてのアカウントIDを数えています...