A query on a MYSQL table containing a Time field returns incorrect data as shown below. The actual data has the times in 15 minute increments starting at midnight as show below. Is there a way to have the times returned correctly? The table definition is show last.

Emacs!

Time    Usage    PctUsage
00:00:00         59.796388888889 0.17307774255302
00:15:00         61.635  0.17839363241679
00:30:00         62.833055555556 0.18185816126275
00:45:00         64.359166666667 0.18566036828694
01:00:00         64.218611111111 0.18600611473168
01:15:00         69.541944444444 0.20142489339448
01:30:00         66.745555555556 0.19331875501834
01:45:00         70.496388888889 0.20419284580398

CREATE TABLE `loadstatistics` (
          `RecordID` int(11) NOT NULL auto_increment,
          `PeriodBegins` datetime NOT NULL default '0000-00-00 00:00:00',
          `Date` date NOT NULL default '0000-00-00',
          `Time` time NOT NULL default '00:00:00',
          `PeriodDOW` int(11) default '0',
          `StatID` int(11) unsigned NOT NULL default '0',
          `CtlEnergyUsed` float default '0',
          `CtlCouldRunLoad` float default '0',
          `CtlEnergyCap` float default '0',
          `EnergyUsed` float default '0',
          `CouldRunLoad` float default '0',
          `EnergyCap` float default '0',
          `PeakLoad` float default '0',
          `LoadCap` float default '0',
          `PeakdT` float default '0',
          `SumdTdt` float default '0',
          `Sumdt` float default '0',
          PRIMARY KEY  (`RecordID`),
          KEY `DateTime` (`PeriodBegins`)
        ) ENGINE=MyISAM DEFAULT CHARSET=latin1

Reply via email to