[solved]problem inputing current time into MSSQL db
I have 2 columns on a table, called "curDate" and "curTime", i want curDate contains the current date, and curTime contains the current time. I have these 2 lines of code that updates those 2 columns in my MSSQL db table.after execute the command, when i retrieve all rows, the curDate column displays correct date format "22/11/05", however, the curTime column got the value " 22/11/05, 00:11:35 AM". why is that? did i make any mistake? the clolumn curTime is type of "datetime" in db. please help, i want the curTime column only gets the value of "00:11:35 AM", that is, only the time.
I have 2 columns on a table, called "curDate" and "curTime", i want curDate contains the current date, and curTime contains the current time. I have these 2 lines of code that updates those 2 columns in my MSSQL db table.after execute the command, when i retrieve all rows, the curDate column displays correct date format "22/11/05", however, the curTime column got the value " 22/11/05, 00:11:35 AM". why is that? did i make any mistake? the clolumn curTime is type of "datetime" in db. please help, i want the curTime column only gets the value of "00:11:35 AM", that is, only the time.
VB.NET:
ModuleUser.frmTesting.SqlCommandAddResult.Parameters("@STARTDATE").Value = Now.ToLongDateString() ModuleUser.frmTesting.SqlCommandAddResult.Parameters("@STARTTIME").Value = Now.ToLongTimeString()
Last edited: