I have a short program that is pulling a date from a database field. I want to take the difference between that date and the current date to see if the date has already passed, and I am using the following code:
Do While Not objRS.EOF
strDateCalc = DateDiff("d",date,objRS("EndDate"
)
If strDateCalc < 0 Then strSQL = "UPDATE Auctions SET BidStatus = No;"
'strSQL = "UPDATE Auctions SET BidStatus = NO;"
Response.Write strDateCalc & "<BR>"
Response.End
Set objCmd = Server.CreateObject("ADODB.Command"
' ---------------------------------Set the command object properties-------------------------------
Set objCmd.ActiveConnection = objConn
objCmd.CommandText = strSQL
objCmd.CommandType = adCmdText
' ------------------------------------Execute the command-----------------------------
objCmd.Execute
Set objCmd = Nothing
objRS.MoveNext
Loop
The code is looping, but it is giving back the wrong numbers. If I do a response.Write strDateCalc, followed by a response.End, it is not calculating properly. Can anyone tell me what I cam doing wrong. Thanks
Do While Not objRS.EOF
strDateCalc = DateDiff("d",date,objRS("EndDate"
If strDateCalc < 0 Then strSQL = "UPDATE Auctions SET BidStatus = No;"
'strSQL = "UPDATE Auctions SET BidStatus = NO;"
Response.Write strDateCalc & "<BR>"
Response.End
Set objCmd = Server.CreateObject("ADODB.Command"
' ---------------------------------Set the command object properties-------------------------------
Set objCmd.ActiveConnection = objConn
objCmd.CommandText = strSQL
objCmd.CommandType = adCmdText
' ------------------------------------Execute the command-----------------------------
objCmd.Execute
Set objCmd = Nothing
objRS.MoveNext
Loop
The code is looping, but it is giving back the wrong numbers. If I do a response.Write strDateCalc, followed by a response.End, it is not calculating properly. Can anyone tell me what I cam doing wrong. Thanks