Index: branches/LCSv1/databases/orginial_data.csv
===================================================================
--- branches/LCSv1/databases/orginial_data.csv	(revision 615)
+++ branches/LCSv1/databases/orginial_data.csv	(revision 615)
@@ -0,0 +1,21 @@
+closures.id,closures.closureid,closures.lognum,closures.route,closures.direction,closures.facility,closures.startdate,closures.enddate,closures.starttime,closures.endtime,closures.startcounty,closures.endcounty,closures.startlocation,closures.endlocation,closures.closuretype,closures.worktype,closures.estdelay,closures.tmpcozeep,closures.tmpdetour,closures.supervisor,closures.fieldrep,closures.meetingplace,closures.reason,closures.reHAL COTAs,closures.s1097date,closures.s1097time,closures.s1097user,closures.s1097phone,closures.s1098date,closures.s1098time,closures.s1098user,closures.s1098phone,closures.s1022date,closures.s1022time,closures.s1022user,closures.s1022phone
+63,T5AA,1,5,NB,Mainline,2020-01-01,2020-01-02,0800,0900,ORA,ORA,BAKER,BRISTOL,Lane,"AC Paving",66,NO,NO,"JORGE MEJIA","","","","",20200320,1609,"JORGE MEJIA","",2020-03-19,1420,"APRIL MAY","",2020-03-19,1421,"JORGE MEJIA",""
+64,T405AA,1,405,NB,Mainline,2020-02-02,2020-03-02,0800,1700,ORA,ORA,BAKER,BRISTOL,Lane,"AC Paving",33,NO,NO,"JORGE MEJIA","","","","",20200319,1618,"JOEL ARRIA","",2020-03-19,1358,"JORGE MEJIA","",2020-03-19,1417,"ORALIA MENDEZ",""
+65,T5AB,1,5,SB,Mainline,2019-01-22,2019-01-25,0800,1700,ORA,ORA,BAKER,BRISTOL,Lane,"AC Paving",33,NO,NO,"JOEL ARRIA","","","","",2020-03-19,1105,"","","","","","","","","",""
+66,T22AA,1,22,NB,Mainline,2000-01-01,2000-10-10,0800,1700,ORA,ORA,BAKER,BRISTOL,Lane,"AC Paving",33,NO,NO,"APRIL MAY","","","","","","","","","","","","","","","",""
+67,T22BB,1,22,WB,Mainline,2000-01-01,2000-10-10,0800,1700,ORA,ORA,BAKER,BRISTOL,Lane,"AC Paving",33,NO,NO,"APRIL MAY","","","","","","","","","","","","","","","",""
+68,T55AA,1,55,NB,"Off Ramp",2000-10-11,2000-10-11,0800,0900,ORA,ORA,BAKER,BRISTOL,Lane,Blasting,22,YES,NO,"JOEL ARRIA","","","","",20200319,1616,"JOEL ARRIA","","","","","","","","",""
+69,T73AA,1,73,WB,Mainline,2020-03-18,2020-03-19,0800,0900,ORA,"",First,Second,Full,Blasting,66,"","","JOEL ARRIA","","","","","","","","","","","","","","","",""
+70,T1AA,1,1,SB,Mainline,2020-03-02,2020-03-26,0700,1700,ORA,ORA,"AVOCADO AVE","LOS TRANCOS",Lane,"Bridge Inspection",70,NO,NO,"HAL COTA","","","","",20200320,1617,"JOEL ARRIA","","","","","","","","",""
+71,T55AB,1,5,SB,"Rest Area",2020-04-01,2020-05-01,0330,1000,ORA,ORA,"EL CAMINO REAL",MAGDALENA,Full,"AC Paving",35,NO,NO,"APRIL MAY","HAL COTA","","","","","","","","","","","","","","",""
+72,T11AB,5,1,NB,Mainline,2020-03-01,2020-03-15,0500,0600,ORA,ORA,BAKER,BRISTOL,Lane,"AC Paving",40,NO,NO,"JOEL ARRIA","HAL COTA","","","","","","","","","","","","","","",
+93,T5AA,1,5,N,Mainline,2020-01-01,2020-01-02,0800,0900,ORA,ORA,BAKER,BRISTOL,Lane,"AC Paving",66,NO,NO,"JORGE MEJIA","","","",,20200320,1609,"JORGE MEJIA","",2020-03-19,1420,"APRIL MAY","",2020-03-19,1421,"JORGE MEJIA",""
+94,T405AA,1,405,N,Mainline,2020-02-02,2020-03-02,0800,1700,ORA,ORA,BAKER,BRISTOL,Lane,"AC Paving",33,NO,NO,"JORGE MEJIA","","","",,20200319,1618,"JOEL ARRIA","",2020-03-19,1358,"JORGE MEJIA","",2020-03-19,1417,"ORALIA MENDEZ",""
+95,T5AB,1,5,S,Mainline,2019-01-22,2019-01-25,0800,1700,ORA,ORA,BAKER,BRISTOL,Lane,"AC Paving",33,NO,NO,"JOEL ARRIA","","","",,2020-03-19,1105,"","","","","","","","","",""
+96,T22AA,1,22,E,Mainline,2000-01-01,2000-10-10,0800,1700,ORA,ORA,BAKER,BRISTOL,Lane,"AC Paving",33,NO,NO,"APRIL MAY","","","",,"","","","","","","","","","","",""
+97,T22BB,1,22,W,Mainline,2000-01-01,2000-10-10,0800,1700,ORA,ORA,BAKER,BRISTOL,Lane,"AC Paving",33,NO,NO,"APRIL MAY","","","",,"","","","","","","","","","","",""
+98,T55AA,1,55,N,"Off Ramp",2000-10-11,2000-10-11,0800,0900,ORA,ORA,BAKER,BRISTOL,Lane,Blasting,22,YES,NO,"JOEL ARRIA","","","",,20200319,1616,"JOEL ARRIA","","","","","","","","",""
+99,T73AA,1,73,NB,Mainline,2020-03-18,2020-03-19,0800,0900,ORA,"",First,Second,Full,Blasting,66,"","","JOEL ARRIA","","","",,"","","","","","","","","","","",""
+100,T1AA,1,1,SB,Mainline,2020-03-02,2020-03-26,0700,1700,ORA,ORA,"AVOCADO AVE","LOS TRANCOS",Lane,"Bridge Inspection",70,NO,NO,"HAL COTA","","","",,20200320,1617,"JOEL ARRIA","","","","","","","","",""
+101,T55AB,1,5,SB,"Rest Area",2020-04-01,2020-05-01,0330,1000,ORA,ORA,"EL CAMINO REAL",MAGDALENA,Full,"AC Paving",35,NO,NO,"APRIL MAY","HAL COTA","","",,"","","","","","","","","","","",""
+102,T55AB,5,1,NB,Mainline,2020-03-01,2020-03-15,0500,0600,ORA,ORA,BAKER,BRISTOL,Lane,"AC Paving",40,NO,NO,"JOEL ARRIA","HAL COTA","","",,"","","","","","","","","","","",""
Index: branches/LCSv1/databases/search_test_data.csv
===================================================================
--- branches/LCSv1/databases/search_test_data.csv	(revision 615)
+++ branches/LCSv1/databases/search_test_data.csv	(revision 615)
@@ -0,0 +1,11 @@
+closures.id,closures.closureid,closures.lognum,closures.route,closures.direction,closures.facility,closures.startdate,closures.enddate,closures.starttime,closures.endtime,closures.startcounty,closures.endcounty,closures.startlocation,closures.endlocation,closures.closuretype,closures.worktype,closures.estdelay,closures.tmpcozeep,closures.tmpdetour,closures.supervisor,closures.fieldrep,closures.meetingplace,closures.reason,closures.reHAL COTAs,closures.s1097date,closures.s1097time,closures.s1097user,closures.s1097phone,closures.s1098date,closures.s1098time,closures.s1098user,closures.s1098phone,closures.s1022date,closures.s1022time,closures.s1022user,closures.s1022phone
+63,T5AA,1,5,NB,Mainline,2020-01-01,2020-01-02,0800,0900,ORA,ORA,BAKER,BRISTOL,Lane,AC Paving,66,NO,NO,JORGE MEJIA,,,,,20200320,1609,JORGE MEJIA,,2020-03-19,1420,APRIL MAY,,2020-03-19,1421,JORGE MEJIA,
+64,T405AA,1,405,NB,Mainline,2020-02-02,2020-03-02,0800,1700,ORA,ORA,BAKER,BRISTOL,Lane,AC Paving,33,NO,NO,JORGE MEJIA,,,,,20200319,1618,JOEL ARRIA,,2020-03-19,1358,JORGE MEJIA,,2020-03-19,1417,ORALIA MENDEZ,
+65,T5AB,1,5,SB,Mainline,2019-01-22,2019-01-25,0800,1700,ORA,ORA,BAKER,BRISTOL,Lane,AC Paving,33,NO,NO,JOEL ARRIA,,,,,2020-03-19,1105,,,,,,,,,,
+66,T22AA,1,22,NB,Mainline,2000-01-01,2000-10-10,0800,1700,ORA,ORA,BAKER,BRISTOL,Lane,AC Paving,33,NO,NO,APRIL MAY,,,,,,,,,,,,,,,,
+67,T22BB,1,22,WB,Mainline,2000-01-01,2000-10-10,0800,1700,ORA,ORA,BAKER,BRISTOL,Lane,AC Paving,33,NO,NO,APRIL MAY,,,,,,,,,,,,,,,,
+68,T55AA,1,55,NB,Off Ramp,2000-10-11,2000-10-11,0800,0900,ORA,ORA,BAKER,BRISTOL,Lane,Blasting,22,YES,NO,JOEL ARRIA,,,,,20200319,1616,JOEL ARRIA,,,,,,,,,
+69,T73AA,1,73,WB,Mainline,2020-03-18,2020-03-19,0800,0900,ORA,,First,Second,Full,Blasting,66,,,JOEL ARRIA,,,,,,,,,,,,,,,,
+70,T1AA,1,1,SB,Mainline,2020-03-02,2020-03-26,0700,1700,ORA,ORA,AVOCADO AVE,LOS TRANCOS,Lane,Bridge Inspection,70,NO,NO,HAL COTA,,,,,20200320,1617,JOEL ARRIA,,,,,,,,,
+71,T55AB,1,5,SB,Rest Area,2020-04-01,2020-05-01,0330,1000,ORA,ORA,EL CAMINO REAL,MAGDALENA,Full,AC Paving,35,NO,NO,APRIL MAY,HAL COTA,,,,,,,,,,,,,,,
+72,T11AB,5,1,NB,Mainline,2020-03-01,2020-03-15,0500,0600,ORA,ORA,BAKER,BRISTOL,Lane,AC Paving,40,NO,NO,JOEL ARRIA,HAL COTA,,,,,,,,,,,,,,,
Index: branches/LCSv1/databases/search_test.sql
===================================================================
--- branches/LCSv1/databases/search_test.sql	(revision 615)
+++ branches/LCSv1/databases/search_test.sql	(revision 615)
@@ -0,0 +1,31 @@
+SELECT * FROM closures WHERE closures.id = "T5AA";
+SELECT * FROM closures WHERE closures.id = "T55AB";
+
+/* closureid + lognum */
+SELECT * FROM closures WHERE closureid = "T55AA" and lognum = 1;
+SELECT * FROM closures WHERE closureid = "T55AA" and lognum = 5;
+
+/* Route */
+SELECT * FROM closures WHERE route = 5;
+SELECT * FROM closures WHERE route = 13;
+
+/* Route + direction */
+SELECT * FROM closures WHERE route = 5 and direction = "N";
+SELECT * FROM closures WHERE route = 5 and direction = "E";
+
+/* Route + start date */
+SELECT * FROM closures WHERE route = 5 and startdate >= "2020-04-01";
+
+SELECT * FROM closures WHERE route = 5 and startdate >= "2020-05-01";
+
+/* Route + end date */
+SELECT * FROM closures WHERE route = 5 and startdate <= "2020-01-23";
+/* entry 71 */
+SELECT * FROM closures WHERE route = 5 and startdate <= "2019-01-07";
+
+/* Route + end date */
+SELECT * FROM closures WHERE route = 5 and startdate >= "2020-03-17" and startdate <= "2020-03-20";
+/* entry 69 */
+SELECT * FROM closures WHERE route = 5 and startdate <= "2019-01-07";
+
+
Index: branches/LCSv1/controllers/default.py
===================================================================
--- branches/LCSv1/controllers/default.py	(revision 612)
+++ branches/LCSv1/controllers/default.py	(revision 615)
@@ -79,5 +79,5 @@
         msg += "Start date = " + session.startdate
     if (len(session.enddate) != 0):
-        query = query & (db.closures.startdate <= session.enddate)
+        query = query & (db.closures.enddate <= session.enddate)
         msg += "End date = " + session.enddate
     
