Comparing date in access database

Posted by Simon on Stack Overflow See other posts from Stack Overflow or by Simon
Published on 2010-05-15T11:08:12Z Indexed on 2010/05/15 11:14 UTC
Read the original article Hit count: 248

Filed under:
|
|

How can i compare the day in the access database to a given day in c#? The date column in the database is an general date(day/month/year)

           try
        {

           database = new OleDbConnection(connectionString);
           database.Open();
           date = DateTime.Now.ToShortDateString();
           string queryString = "SELECT user_name,zivila.naziv "
               + "FROM (users LEFT JOIN obroki_save ON obroki_save.ID_uporabnika=users.ID)"
               + " LEFT JOIN zivila ON zivila.ID=obroki_save.ID_zivila "
               + " WHERE users.ID= " + a.ToString() + " AND obroki_save.datum=# " + date; 
           loadDataGrid(queryString);
       }
       catch (Exception ex)
       {
           MessageBox.Show(ex.Message);
           return;
       }

© Stack Overflow or respective owner

Related posts about c#

Related posts about ms-access