Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time format

Status
Not open for further replies.

Mingas

Programmer
Jul 10, 2013
15
ZA
Please help, i have a colomn in my SQL database called "Actual" it is set to data type "time(8)"

Through a web app designed in asp .net....on Onclick event of a button...I'm trying to take a value of a text box and update my DB table as follow:

string txt = tb.Text;
string query = "Update Jobs Set Actual = 'CONVERT(VARCHAR(8),+ txt +,8)'";



No matter what i try, I keep getting this error:

Conversion failed when converting date and/or time from character string.
 
change to
Code:
string txt = tb.Text;
string query = "Update Jobs Set Actual = 'CONVERT(VARCHAR(8), " + txt + ", 8)'";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top