Dim Bd As String = Format(Me.startdate.Value, "yyyy/MM/dd" )
Dim Bd1 As String = Format(Me.enddate.Value, "yyyy/MM/dd")
Dim sql As String = "select TDATE from T_PACK where TDATE BETWEEN '" & Bd.ToString & "' AND '" & Bd1.ToString & "'"
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US")
Dim Bd As String = Me.DateTimePicker1.Value.ToString("yyyy-MM-dd")
Dim Bd1 As String = Me.DateTimePicker2.Value.ToString("yyyy-MM-dd")
Dim sql As String = "select TDATE from T_PACK where TDATE BETWEEN '" + Bd + "' AND '" + Bd1 + "' "
' หรือ
'Dim sql As String = "select TDATE from T_PACK where convert(date,TDATE ,103) BETWEEN '" + Bd + "' AND '" + Bd1 + "' "
End Sub