Hi,
I creating this form where one of the fields shows the current date and time (read only). i want to insert this current date into my SQL database table under a certain column (varchar type). I didnt use any of the date or time types because their size is standard. When I created test forms and submitted it to my database. The current date and time is display in the table like this: 1/1/1900 12:00:00 AM. Im assuming this is the default dateTime. Im not sure how to fix this problem.
Here is my code:
This is my insert statement:
oConn.Open(ConnectionString)
queryStr = "INSERT INTO tblPDRitem ( pdrItemCreationTime, packageName, packageType, actionRequested, distributionServers) VALUES('" & currentDateEntry & "','" & TRIM(Request.QueryString("packageName")) & "', '" & TRIM(Request.QueryString("packageType")) & "','" & TRIM(Request.QueryString("actionRequested")) & "','" & TRIM(list) & "')"
Set oRsSub = oConn.Execute(queryStr)
oConn.Close
This is where I input the date in the form:
<input type = "text" readonly name= "currentDate" value="<%= FormatDateTime(Now) %>" />
Thx
I creating this form where one of the fields shows the current date and time (read only). i want to insert this current date into my SQL database table under a certain column (varchar type). I didnt use any of the date or time types because their size is standard. When I created test forms and submitted it to my database. The current date and time is display in the table like this: 1/1/1900 12:00:00 AM. Im assuming this is the default dateTime. Im not sure how to fix this problem.
Here is my code:
This is my insert statement:
oConn.Open(ConnectionString)
queryStr = "INSERT INTO tblPDRitem ( pdrItemCreationTime, packageName, packageType, actionRequested, distributionServers) VALUES('" & currentDateEntry & "','" & TRIM(Request.QueryString("packageName")) & "', '" & TRIM(Request.QueryString("packageType")) & "','" & TRIM(Request.QueryString("actionRequested")) & "','" & TRIM(list) & "')"
Set oRsSub = oConn.Execute(queryStr)
oConn.Close
This is where I input the date in the form:
<input type = "text" readonly name= "currentDate" value="<%= FormatDateTime(Now) %>" />
Thx