Talk:De/EÜR

From GnuCash
Revision as of 15:09, 15 November 2008 by Rolf (talk | contribs) (Neustart mit MySQL)
Jump to: navigation, search

Neustart mit MySQL

  • CREATE OR REPLACE VIEW `GCfibu`.`UStVa` AS SELECT YEAR( `transactions`.`post_date` ) AS `Y`, QUARTER( DATE_ADD( `transactions`.`post_date`, INTERVAL 2 HOUR) ) AS `Q`, `accounts_ext`.`UStVa`, SUM( `splits`.`value_num` )/100 AS `EUR` FROM `GCfibu`.`transactions` AS `transactions`, `GCfibu`.`splits` AS `splits`, `GCfibu`.`accounts` AS `accounts`, `GCfibu`.`accounts_ext` AS `accounts_ext` WHERE `transactions`.`guid` = `splits`.`tx_guid` AND `accounts`.`guid` = `splits`.`account_guid` AND `accounts`.`code` = `accounts_ext`.`codeID` GROUP BY `Y`, `Q`, `accounts_ext`.`UStVa` HAVING ( ( `accounts_ext`.`UStVa` > 0 ) ) ;
  • select `Rolf`.`Table1`.`txID` AS `txID`,`Rolf`.`Table1`.`splitID` AS `splitId`,abs(`Rolf`.`Table1`.`value`) AS `abs(value)`,`Rolf`.`Table1`.`accountID` AS `accountid`,if((`Rolf`.`Table1`.`value` < 0),_utf8'left',_utf8'right') AS `type` from `Table1` -> clever use of the if-statement to create a column with conditional data