本帖最後由 X-Engineer 於 2016-12-12 15:45 編輯
結果出來的是, 由12/12/2016至31/10/2017
不知為何
Please HELP, THANKS Bro!!
SELECT [Employee Number], [Chinese Name], [English Name], [Tel Number], [Expiry Date] FROM Employee Where [Expiry Date] between #12/12/2016# and #11/1/2017#- Dim con As OleDbConnection
- Dim da As OleDbDataAdapter
- Dim dt As New DataTable
複製代碼- Dim today = DateTime.Now.Date
- Dim an1 = today.AddDays(+31)
- Dim an2 = today.AddDays(+61)
- con = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=|DataDirectory|\IWSDatabase.accdb")
- con.Open()
- da = New OleDbDataAdapter("SELECT [Employee Number], [Chinese Name], [English Name], [Tel Number], [Expiry Date] FROM Employee Where [Expiry Date] between #" + an1.Date + "# and #" + an2.Date + "#", con)
- da.Fill(dt)
- NotifyDataGridView.DataSource = dt.DefaultView
- con.Close()
複製代碼 |