Yes - but you would need to change your query slightly. I assume you are issuing this from a langauge of some form, rather than entering directly into SQL yourself, in which case, pass the start and end dates as parameters to the SqlCommand (I'll show it in C#):
using (SqlConnection con = new SqlConnection(strConnect))
{
con.Open();
using (SqlCommand com = new SqlCommand("SELECT *, @STARTDATE AS StartDate. @ENDDATE AS EndDate FROM tblDailyMaintenceDetails WHERE MaintenceDate BETWEEN @STARTDATE AND @ENDDATE", con))
{
com.Parameters.AddWithValue("@STARTDATE", new DateTime(2008, 12, 28));
com.Parameters.AddWithValue("@ENDDATE", new DateTime(2013, 4, 6));
using (SqlDataReader reader = com.ExecuteReader())
{
while (reader.Read())
{
...
}
}
}
}
You don't need to use parameters, it just makes it easier to keep the two dates the same in both parts of the SQL