Changeset 8751 for trunk/MagicSoft
- Timestamp:
- 10/07/07 22:04:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/plotdb.C
r8740 r8751 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.3 6 2007-09-05 17:05:35tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.37 2007-10-07 21:04:00 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 414 414 case kNone: 415 415 case kGroupByPrimary: 416 query += valued;416 query += Form("%s AS %s", valued.Data(), valued.Data()+1); 417 417 break; 418 418 case kGroupByHour: 419 query += Form("DATE_FORMAT(%s, '%%Y-%%m-%%d %%H:30:00') AS %s ", fPrimaryDate.Data(), valued.Data() );419 query += Form("DATE_FORMAT(%s, '%%Y-%%m-%%d %%H:30:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 420 420 break; 421 421 case kGroupByNight: 422 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-%%d 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data() );422 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-%%d 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 423 423 break; 424 424 case kGroupByWeek: 425 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%x%%v') AS %s ", fPrimaryDate.Data(), valued.Data() );425 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%x%%v') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 426 426 break; 427 427 case kGroupByMonth: 428 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data() );428 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 429 429 break; 430 430 case kGroupBySeason: 431 //query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data() );431 //query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 432 432 break; 433 433 case kGroupByYear: 434 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-08-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data() );434 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-08-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 435 435 break; 436 436 } … … 493 493 if (fGroupBy!=kNone) 494 494 { 495 query += Form("GROUP BY %s ", valued.Data() );495 query += Form("GROUP BY %s ", valued.Data()+1); 496 496 //query += Form(" HAVING COUNT(%s)=(COUNT(*)+1)/2 ", valuev.Data()); 497 497 } 498 query += Form("ORDER BY %s ", valued.Data() );498 query += Form("ORDER BY %s ", valued.Data()+1); 499 499 500 500 … … 521 521 void plotall(MPlot &plot) 522 522 { 523 //plot.SetGroupBy(MPlot::kGroupBy Week);523 //plot.SetGroupBy(MPlot::kGroupByNight); 524 524 525 525 plot.SetPrimaryDate("Sequences.fRunStart");
Note:
See TracChangeset
for help on using the changeset viewer.