Still at it....

    Date: 07/21/05 (MySQL Communtiy)    Keywords: no keywords

    $Query = "SELECT invoice_number, sum(((TIME_TO_SEC(end_time) - TIME_TO_SEC(start_time))/3600) * rate) FROM invoice_items GROUP BY invoice_number HAVING office_id='$office_id' AND service_type!='225' ORDER BY invoice_number";

    Error: Unknown column 'office_id' in 'having clause'

    However, office_id is a column. And the query works if I remove sum, GROUP BY, and change HAVING to WHERE.

    More on the time conversion

    Source: http://www.livejournal.com/community/mysql/63088.html

« Query help - Most recent date || Query help: summing colums... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home