ItHurtsWhenIThink
Technical User
Do not know why, but when ever I update a record (specifically the date colomn) the date gets incremented by one +1 day.
I know that the value passed to it is correct, but when it updates the value to the database it just adds one day to the date value.
I've pulled much of my hair out, all that's left is nubs.
Please help.
Here is the chunck of code with the problem:
LeaveDate field is the problem child. data type= smalldate, typ value= "12/23/2009"
set rs = Server.CreateObject("ADODB.Recordset")
sqlstatement="SELECT * FROM LeaveRequests WHERE LeaveID=" & intID
rs.Open sqlstatement, ConnectionString(),1,3
rs("ApprovedBy")=Request.Cookies("UserID")
rs("Status")="Approved"
rs("CalendarID")=intNewID
rs("TakenBy")=intRep
rs("StartTime")=STime
rs("EndTime")=ETime
rs("TypeShift")=varTypeShift
rs("LeaveDate")=strDate
response.write("LDate=" & strDate & "<BR>")
rs("TypeLeave")=NewString(Request.Form("frmType"))
If strNotes<>"Add Notes Here." Then
rs("Notes")=strNotes
End If
rs.Update
rs.close
set rs = nothing
Thanks,
I know that the value passed to it is correct, but when it updates the value to the database it just adds one day to the date value.
I've pulled much of my hair out, all that's left is nubs.
Please help.
Here is the chunck of code with the problem:
LeaveDate field is the problem child. data type= smalldate, typ value= "12/23/2009"
set rs = Server.CreateObject("ADODB.Recordset")
sqlstatement="SELECT * FROM LeaveRequests WHERE LeaveID=" & intID
rs.Open sqlstatement, ConnectionString(),1,3
rs("ApprovedBy")=Request.Cookies("UserID")
rs("Status")="Approved"
rs("CalendarID")=intNewID
rs("TakenBy")=intRep
rs("StartTime")=STime
rs("EndTime")=ETime
rs("TypeShift")=varTypeShift
rs("LeaveDate")=strDate
response.write("LDate=" & strDate & "<BR>")
rs("TypeLeave")=NewString(Request.Form("frmType"))
If strNotes<>"Add Notes Here." Then
rs("Notes")=strNotes
End If
rs.Update
rs.close
set rs = nothing
Thanks,