Date
2014-12-01 10:52:38
2014-12-01 10:52:14
2014-12-01 10:51:57
2014-12-01 10:35:34
2014-12-01 10:23:17
2014-12-01 10:22:18
2014-12-01 09:03:49
2014-12-01 08:53:51
I have this column with these dates and I need to do a select that filters as follows: SET PARAMETER DOM aaaaMMDdd with value already specified and I want the routine to bring me only the dates of a day. The difficulty is that the column is in the format yyyy-MM-dd HH: mm: ss and the select below does not bring me anything. How to make? Thankful
I'm working with C # winform and MYSQL. Att Marcos
static public string SelectQuantidadeRenavan(MySqlConnection db, string renavam,string datarecebe)
{
string strdata = Convert.ToDateTime(datarecebe).ToString("yyyy-MM-dd");
StringBuilder selectQuantidadeRenavam = new StringBuilder();
selectQuantidadeRenavam.AppendFormat("select count(RENAVAM)");
selectQuantidadeRenavam.AppendFormat(" from numtermo ");
selectQuantidadeRenavam.AppendFormat("WHERE ");
//selectQuantidadeRenavam.AppendFormat("RENAVAM = 1) {0}", renavam);
selectQuantidadeRenavam.AppendFormat("RENAVAM = {0} and Data = '{1}'", renavam, strdata)
MySqlCommand MysqlResult = new MySqlCommand(selectQuantidadeRenavam.ToString(), db);
return MysqlResult.ExecuteScalar().ToString();
}