我试图在DataGridView中对数据进行排序,这是行不通的,因为函数是专门排序的一天。不排序月份和年份。
sql = "SELECT * FROM data_timein WHERE (CONVERT(datetime,day_in,103) >= '" & date1 & "') AND (CONVERT(datetime, day_in,103) <= '" & date2 & "')"
DataGridView1.DataSource = cmd_ExcuteDataTable()
DataGridView1.Sort(DataGridView1.Columns(2),System.ComponentModel.ListSortDirection.Ascending)