c# - Comparing date in access database -


I can how to compare a given day in C # using the database of the day? A common date date columns in the database (day / month / year)

  try {database = new OleDbConnection (connectionString); Database.Open (); Date = DateTime.Now ShortStat String (); String query string = "Select user_name, zivila.naziv" + "from (obroki_save.ID_uporabnika on obroki_save join those left = users.ID)" + "zivila.ID = obroki_save.ID_zivila" on zivila Join Left + " Where users.ID = "+ A.ToString () +" and obroki_save.datum = # "+ date; LoadDataGrid (query string); } Hold (Exception pre) {Message Box. Show (ex.Message); Return; }  

If you need a hash (#) after the date literal. You may also have to specify a culture when it matches the database expected, or formatting the date to use a specific format string.

However, if you must use the numeric price, but parameter query. So you do not have to worry about getting the date format. Database


Comments