lundi 4 juillet 2016

how to use vb update current date time?

i was doing a update record but i cant update the time to my access file

the Issue_Daate data type are Date/Time and format i set is as general date

here is my code

Dim totalprice As Decimal = FormatCurrency(total_after_gst)
    Dim today As DateTime = System.DateTime.Now
    Dim status As String = "Completed"
    Dim sql1 As String = "Update [ordertbl] SET [Total_Price]=" & totalprice & ", [Issue_date]=" & today & ", [Status]='" & status & "' Where [ID] = " & code & " "
    Dim cmd1 As OleDbCommand = New OleDbCommand(sql1, conn)

    cmd1.Connection = conn
        cmd1.ExecuteScalar()

i have an error which is

An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll

Additional information: Syntax error (missing operator) in query expression '19/6/2016 03:27:52'.

i no sure which operator are missing=

Aucun commentaire:

Enregistrer un commentaire