select date between two datetimepicker vb.net

  • Thread starter Thread starter euchan09
  • Start date Start date
E

euchan09

Guest
hello?

i used this query to show my data from database based on the values in my two datetimepicker:

"select * from tbl_records where name ='" & Label1.Text & "' and STR_TO_DATE(date, '%d/%m/%Y') between STR_TO_DATE(CONCAT ('" & BunifuDatepicker1.Value.Date & "') ,'%d/%m/%Y') AND LAST_DAY(STR_TO_DATE(CONCAT('" & BunifuDatepicker2.Value.Date & "'),'%d/%m/%Y'))"


what i want to happen is for example i set the date from datetimepicker1 "08/08/2018" and set "09/10/2018" in datetimepicker2, the data with the same date "08/08/2018" to "09/10/2018" will show in my datagridview. I used the Query above but it doesn't end base on the value in datetimepicker2. It only shows the values from datetimepicker1 continuously until the end of the data in database table.

Note: the date format is DD/MM/YYYY

can anyone please help me? thank you!

Continue reading...
 
Back
Top