Index: trunk/FACT++/src/makeschedule.cc
===================================================================
--- trunk/FACT++/src/makeschedule.cc	(revision 18437)
+++ trunk/FACT++/src/makeschedule.cc	(revision 18438)
@@ -18,7 +18,7 @@
     po::options_description control("Makeschedule");
     control.add_options()
-        ("date", var<string>(), "SQL time (UTC), e.g. '2016-12-24'")
-        ("source-database", var<string>(""), "Database link as in\n\tuser:password@server[:port]/database.")
-        ("schedule-database", var<string>(""), "Database link as in\n\tuser:password@server[:port]/database.")
+        ("date", var<string>(), "SQL time (UTC), e.g. '2016-12-24' (equiv. '2016-12-24 12:00:00' to '2016-12-25 11:59:59')")
+        ("source-database", var<string>()->required(), "Database link as in\n\tuser:password@server[:port]/database.")
+        ("schedule-database", var<string>(), "Database link as in\n\tuser:password@server[:port]/database.")
         ("max-current", var<double>(90), "Global maximum current limit in uA")
         ("max-zd", var<double>(75), "Global zenith distance limit in degree")
@@ -460,10 +460,10 @@
     map<string, uint32_t> types;
     for (const auto &row: res1)
-        types.emplace(string(row[0]), uint32_t(row[1]));
+        types.insert(make_pair(string(row[0]), uint32_t(row[1])));
 
     ostringstream str;
     str << "INSERT INTO Schedule (fStart, fUser, fMeasurementID, fMeasurementTypeKEY, fSourceKEY) VALUES\n";
 
-    str << "('" << Time(obs[0].begin-startup_offset).GetAsStr() << "', auto, 0, " << types["Startup"] << ", NULL), [Startup]\n";
+    str << "('" << Time(obs[0].begin-startup_offset).GetAsStr() << "', auto, 0, " << types["Startup"] << ", NULL),\n"; // [Startup]\n";
     for (const auto& src: obs)
     {
@@ -481,10 +481,10 @@
 
         if (src.name!="SLEEP")
-            str << "('" << tm << "', auto, 0, " << types["Data"] << ", " << src.key << "), [Data: " << src.name << "]\n";
+            str << "('" << tm << "', auto, 0, " << types["Data"] << ", " << src.key << "),\n"; // [Data: " << src.name << "]\n";
         else
-            str << "('" << tm << "', auto, 0, " << types["Sleep"] << ", NULL), [Sleep]\n";
-    }
-
-    str << "('" << Time(obs.back().end).GetAsStr() << "', auto, 0, " << types["Shutdown"] << ", NULL) [Shutdown]";
+            str << "('" << tm << "', auto, 0, " << types["Sleep"] << ", NULL),\n"; // [Sleep]\n";
+    }
+
+    str << "('" << Time(obs.back().end).GetAsStr() << "', auto, 0, " << types["Shutdown"] << ", NULL)";// [Shutdown]";
 
     if (enter<0)
@@ -519,5 +519,5 @@
     Time time;
     if (conf.Has("date"))
-        time.SetFromStr(conf.Get<string>("date"));
+        time.SetFromStr(conf.Get<string>("date")+" 12:00:00");
 
     if (enter && floor(time.JD())<ceil(Time().JD()))
