DateTime from C# to SQL

string tempDate;

tempDate = Convert.ToDateTime(dataGridView1.CurrentRow.Cells[1].Value.ToString()).ToString(“yyyy-MM-dd HH:mm:ss”);

query = “UPDATE…WHERE CheckDate = CONVERT(datetime, ‘” + tempDate + “‘, 121)”;

Check if a column value exists in another column

SELECT ID FROM tableName WHERE Calling_ID IN (SELECT Called_ID FROM tableName)