Last post Oct 07, 2008 05:01 PM by Mikesdotnetting
Oct 07, 2008 04:31 PM|Afroze.Oersla|LINK
i have one mdb access database, in which i have one table with datetime datatype column and that column values in the format 'DD/MM/YYYY HH:MM;SS AM'
now i am making a asp.net interface, where i will ask users to select two dates and i have to query the above table and display the results whose date is between the users selected dates.
how to construct the query? database is of huge size, so having like in the query will affect the performance very badly.
so could any one tell how to construct the performance based query?
waiting for reply
Oersla Afroze Ahmed
Oct 07, 2008 05:01 PM|Mikesdotnetting|LINK
SELECT fields FROM table WHERE thedatefield >= ? AND thedatefield <= ?
The first parameter value will be the lowest date and time, and the second is the upper bound, or highest. More on the use of parameters here:
Oh, and LIKE will not work with DateTimes.