2
Answers

Date select option from one column

Shovan Saha

Shovan Saha

7y
201
1
string sql = "SELECT * FROM LalData WHERE PaymentDate between '"+ dtpStartDate.Value.AddDays(-1).ToString() + "' AND '" + dtpEndDate.Value.ToString()+"'";
 
I need data from start date but when I select a date from datetimepicker, that takes the value from the next day. That is why, I used AddDays(-1). But it is well for within any month. When I select two days from two datetimepicker for two month but it does not work. Can anyone help me? 
Answers (2)