I've got the following code:
sql = "UPDATE TaskWorkHistory set MinutesWorked = MinutesWorked + @MinutesWorked " + "WHERE DateWorked = @DateWorked and [email protected] and [email protected]"; ...code here OleDbCommand cmd = new OleDbCommand(sql, conn); cmd.Parameters.AddWithValue("@TaskID", (int)r.Cells["ID"].Value); cmd.Parameters.AddWithValue("@MinutesWorked", double.Parse(r.Cells["Minutes_Worked"].Value.ToString())); cmd.Parameters.AddWithValue("@DateWorked", now.ToShortDateString()); cmd.Parameters.AddWithValue("@UserID", myRefs.GetUserID(r.Cells["Owner"].Value.ToString()));
It only works if I only use the TaskID condition.
To debug it, I also removed the parameters and entered the actual values and it worked.
I guess it has something to do with how it resolves the date but I cant figure out what would be wrong with using the UserID.
I'm using MS Access.
anyone know why the date and the userId would not work pls?
thanks

New Topic/Question
Reply



MultiQuote



|