Which database are you using you can use javascript to get the records like below:
You can use javascript library called ACCESSdb which can be found here:
ACCESSdb[^]
function SelectRecords(startdate, enddate) {
var adoConn = new ActiveXObject("ADODB.Connection");
var adoCmd = new ActiveXObject("ADODB.Command");
adoConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='\\dbName.mdb'");
adoCmd.ActiveConnection = adoConn;
adoCmd.CommandText("Select * From tblName Where Date between startdate and enddate");
adoCmd.Execute();
adoConn.Close();
}
Ref:
Here