Reputation: 23
I am using jCalender to input date
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
Upvotes: 2
Views: 969
Reputation: 1246
I'm not java pro but SQL statement could be like this
select * from POSTS where Id = 1
and Date between '2011/02/25' and '2011/02/27'
or can use
select * from POSTS where Id = 1
and Date >= '2011/02/25' and Date <= '2011/02/27'
Upvotes: 1