Welcome Guest, Not a member yet? Register   Sign In
sql is not compiled properly
#6

I am still waiting from someone at Codeigniter to acknowledge that this is a bug.



(01-08-2015, 12:52 AM)cperrot Wrote: SELECT `name`, `bamboo_invoices`.`currency_symbol`, SUM(`amount` * quantity) AS amount, SUM( ROUND((bamboo_invoice_items.amount*bamboo_invoices.tax1_rate/100 * bamboo_invoice_items.quantity) / 0.05, 0) * 0.05) as tax1_collected, SUM( ROUND((bamboo_invoice_items.amount*bamboo_invoices.tax2_rate/100 * bamboo_invoice_items.quantity) / 0.05, 0) * 0.05) as tax2_collected, SUM(ROUND((bamboo_invoice_items.amount * bamboo_invoices.accounting_invoice_exchange_rate * bamboo_invoice_items.quantity + ((bamboo_invoice_items.amount * bamboo_invoices.accounting_invoice_exchange_rate) *bamboo_invoice_items.quantity * (bamboo_invoices.tax1_rate/100 + bamboo_invoices.tax2_rate/100) * bamboo_invoice_items.taxable)) / 0.05, `0)` * 0.05 ) AS accounting_total_with_tax FROM (`bamboo_clients`) JOIN `bamboo_invoices` ON `bamboo_invoices`.`client_id` = `bamboo_clients`.`id` JOIN `bamboo_invoice_items` ON `bamboo_invoices`.`id` = `bamboo_invoice_items`.`invoice_id` WHERE `dateIssued` >= "2014-01-01" and dateIssued <= "2015-01-08" GROUP BY `name` ORDER BY `bamboo_invoices`.`currency_type`, `bamboo_clients`.`name`

As requested I closed the parent parenthesis right after the zero without space and the quote gets placed after the parenthesis

The first round in the select is perfectly fine and the second Round gets the quotes.






(01-07-2015, 12:28 PM)mwhitney Wrote: You probably need to change each of your select('SUM(...' statements to select_sum('...' statements. The first thing the select method does is explode the input on the comma, so the round functions are being handled in 2 parts. The amazing thing here is that only the last zero is quoted.

EDIT: Something odd I just noticed... Does removing the space between the zero and the closing paren in the last select statement prevent the zero from being quoted in the output?
Reply


Messages In This Thread
sql is not compiled properly - by cperrot - 12-31-2014, 08:51 AM
RE: sql is not compiled properly - by jlp - 12-31-2014, 04:06 PM
RE: sql is not compiled properly - by cperrot - 12-31-2014, 11:30 PM
RE: sql is not compiled properly - by mwhitney - 01-07-2015, 12:28 PM
RE: sql is not compiled properly - by cperrot - 01-08-2015, 12:52 AM
RE: sql is not compiled properly - by cperrot - 01-08-2015, 12:53 AM
RE: sql is not compiled properly - by mwhitney - 01-08-2015, 09:36 AM
RE: sql is not compiled properly - by zepernick - 01-14-2015, 06:56 AM
RE: sql is not compiled properly - by CroNiX - 01-21-2015, 04:34 PM
RE: sql is not compiled properly - by cperrot - 04-18-2015, 12:19 AM
RE: sql is not compiled properly - by cperrot - 04-18-2015, 06:09 AM
RE: sql is not compiled properly - by cperrot - 04-18-2015, 06:56 AM
RE: sql is not compiled properly - by cperrot - 11-02-2016, 11:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB