AccessDataSource Where date = today?

Hi,

I'm want to query a table in an Access DB where the Date field is = today's date, so that in a datagrid I can return values that were entered today only.

I'm not using connection strings, I'm using the AccessDataSource function on new Web Developer 2005, and trying to configure theWHERE clause in the select statement to today's date.

Any ideas



Answer this question

AccessDataSource Where date = today?

  • Ron Snoke

    hi,

    in other forum they said its not good to use string format in query, its better to use parameters and they have examples for that

    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=250908&SiteID=1

    Hope this helps



  • zograf

    hi,

    you can try something like this

    string today = DateTime.Now.ToShortDateString();

    string sqlstr = string.Format("select * from mytable where date = '{0}'", today);

    hope this helps



  • AccessDataSource Where date = today?