I am running this query for updating the datetime column in my table:
DateTime today = DateTime.Today;
string[] queries = new string[] { "UPDATE *** SET ExpirationDate = " + today.ToString("yyyy/MM/dd"),
"UPDATE *** SET WrittenDate = " + today.ToString("yyyy/MM/dd"),
"UPDATE *** SET SystemDate = " + today.ToString("yyyy/MM/dd"),
"UPDATE *** SET SystemDate = " + today.ToString("yyyy/MM/dd"),
"UPDATE *** SET EventDate = " + today.ToString("yyyy/MM/dd")};
This format is based off of what I found in this thread: Operand type clash: int is incompatible with date + The INSERT statement conflicted with the FOREIGN KEY constraint
But it is not working. I know that they are datetime fields because I can successfully perform DATEADDs on them. I just want to set all the records in these columns to the current date, but I keep getting the same error even with all the different ways I've tried. Advance thanks for any help!