Add Column to Show Time
Dear Users,
Do anyone know how to add a column to show the time separately from the date. I am retreiving the Long Date(11/2/2003 11:30pm) from an Access Database?
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'GetUser()
Lost = 0
If txtStart.Text = "" And txtEnd.Text = "" Or CboItems.Text = "" Then
MsgBox("Select Date from Above Calendar or Item - Thank you")
Else
kStart = txtStart.Text
kStop = txtEnd.Text
nItem = CboItems.Text
Dim conStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\DATA\ACCESS\13FloorEquipment.mdb"
Dim strSQL As String = "SELECT [ItemName], [StartDate],[EndDate],[NTID] FROM(Requests) "
strSQL = strSQL & "WHERE (([ItemName]= '" & nItem & "')"
strSQL = strSQL & "AND (([StartDate])"
strSQL = strSQL & "BETWEEN #" & kStart & " 12:00:00 AM #"
strSQL = strSQL & "AND #" & kStop & " 11:59:59 PM #));"
'MsgBox(strSQL)
Dim conn As OleDbConnection = New OleDbConnection(conStr)
conn.Open()
Dim da As OleDbDataAdapter = New OleDbDataAdapter(strSQL, conn)
Dim ds As DataSet = New DataSet()
da.Fill(ds, "Requests")
Dim dv As DataView = ds.Tables("Requests").DefaultView
DataGrid1.DataSource = dv
DataGrid1.ReadOnly = True
conn.Close()
'Next
End If
End Sub
|