Shovan Saha

Shovan Saha

  • NA
  • 321
  • 91.9k

Date select option from one column

Mar 17 2017 3:38 PM
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)