I am using alasql to get data between given date range from array of object in JavaScript. i tried below query but i am not getting any result. i am passing start date and end date and i want the data between those range only, if there is any other way to do this then it will help me also. please help me to do this, thanks in advance
startTime = Sun Mar 27 2016 00:00:00 GMT+0530 (India Standard Time)
endTime = Sat Apr 02 2016 00:00:00 GMT+0530 (India Standard Time)
data= [
{
name:'Sam',
reportDate:'3/25/2016 16:34:00 PM'
},{
name:'Mac',
reportDate:'3/27/2016 10:26:00 PM'
},{
name:'Sandy',
reportDate:'3/30/2016 19:14:00 AM'
},{
name:'Smith',
reportDate:'4/2/2016 14:54:00 PM'
},{
name:'Warner',
reportDate:'4/4/2016 17:04:00 AM'
},{
name:'Finch',
reportDate:'3/28/2016 11:20:00 PM'
}
]
alasql("SELECT * from ? WHERE DATE([[0].reportDate]) >=" + startDate + "AND DATE([[0].reportDate]) <= " + endDate + "", [data]);