I'm trying to get the date from my database and stores it in a variablehere is the data from my table
This is my current code but this take time and date
SqlCommand command2 = new SqlCommand("SELECT timeOut_AM FROM TimeOut_AM WHERE FORMAT(timeOut_AM, 'yyyy/MM/dd') = CONVERT (DATE, SYSDATETIME());", conn);
SqlDataReader reader2 = null;
conn.Open();
reader2 = command2.ExecuteReader();
while (reader2.Read())
{
chkDate_AM = Convert.ToString(reader2["timeOut_AM"]);
}
conn.Close();