3

jCalenderを使用して日付を入力しています

String from_date = ((JTextField) txt_bilty_date_start.getDateEditor().getUiComponent()).getText();
String to_date = ((JTextField) txt_bilty_date_end.getDateEditor().getUiComponent()).getText();
String sql = " "; //what query I need to use

ここに画像の説明を入力

4

1 に答える 1

3

私はJavaのプロではありませんが、SQLステートメントは次のようになります

select * from POSTS where Id = 1
       and Date between '2011/02/25' and '2011/02/27'

または使用できます

select * from POSTS where Id = 1
       and Date >= '2011/02/25' and Date <= '2011/02/27'
于 2016-01-27T19:31:23.333 に答える