Reputation: 1973
I'm using Microsoft access with asp.net and vb.net to create a form page. I'd like to get the timestamp once I click on the save button. I managed to use this line of code to do that
Dim time1 As New OleDbCommand("INSERT INTO Quest(TimeUS1) VALUES (Now())", cn)
time1.ExecuteNonQuery()
However, it saves both the date and time. I'm only interested in time.Any idea on how to only extract time ?
Really appreciate your time here.
Upvotes: 0
Views: 45
Reputation: 32632
You use the built-in Time()
function
Dim time1 As New OleDbCommand("INSERT INTO Quest(TimeUS1) VALUES (Time())", cn)
time1.ExecuteNonQuery()
Upvotes: 2