I am attempting to use a sql query to update a record using the following:

cmd.CommandText = "UPDATE ScannerData Set DateReceived = " & Date.Now & " WHERE ScanNumber = " + TheReaderData.Text + ""

I receive a parse error at the Date.Now portion of the statement. Is there a way to use a sql UPDATE command and concatenate in the Data. Now?

I think you can put that directly in the sql query, without having to pull the date from VB (ie: NOW()) but, doing it the way you are doing it works fine for me in vb 2008 express edition. You might consider adding the () to the end of Now, OR replacing the & with +'s

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.